Skip to content

Commit ff637d6

Browse files
committed
core: fix move_view_to_output for views without an output
Fixes #2914
1 parent b089178 commit ff637d6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/core/core.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,16 +626,17 @@ void wf::move_view_to_output(wayfire_toplevel_view v, wf::output_t *new_output,
626626

627627
auto old_output = v->get_output();
628628
auto old_wset = v->get_wset();
629-
auto old_ws = old_wset->get_view_main_workspace(v);
630629
auto new_wset = new_output->wset();
630+
const bool reconfigure = (flags & VIEW_TO_OUTPUT_FLAG_RECONFIGURE) && (old_output != nullptr);
631+
const bool same_workspace = (flags & VIEW_TO_OUTPUT_FLAG_SAME_WORKSPACE) && reconfigure &&
632+
(old_wset != nullptr);
631633

632634
uint32_t edges;
633635
bool fullscreen;
634-
bool reconfigure = flags & VIEW_TO_OUTPUT_FLAG_RECONFIGURE;
635-
bool same_workspace = flags & VIEW_TO_OUTPUT_FLAG_SAME_WORKSPACE;
636636
wf::geometry_t view_g;
637637
wf::geometry_t old_output_g;
638638
wf::geometry_t new_output_g;
639+
wf::point_t old_ws = {0, 0};
639640

640641
int delta_x = 0;
641642
int delta_y = 0;
@@ -654,6 +655,10 @@ void wf::move_view_to_output(wayfire_toplevel_view v, wf::output_t *new_output,
654655

655656
delta_x = view_g.x - v->get_pending_geometry().x;
656657
delta_y = view_g.y - v->get_pending_geometry().y;
658+
if (same_workspace)
659+
{
660+
old_ws = old_wset->get_view_main_workspace(v);
661+
}
657662
}
658663

659664
assert(new_output);

0 commit comments

Comments
 (0)