foreign: fix initial leave/enter event bug

Create foreign-toplevel-handle after initial view positioning to ensure
leave/enter events are sent to the correct output.

Fixes: #744
This commit is contained in:
Johan Malm 2023-01-31 21:37:32 +00:00
parent 1995a33df9
commit c81ac99d82
2 changed files with 10 additions and 5 deletions

View file

@ -344,7 +344,6 @@ xdg_toplevel_view_map(struct view *view)
if (!view->been_mapped) {
struct wlr_xdg_toplevel_requested *requested =
&xdg_toplevel_from_view(view)->requested;
foreign_toplevel_handle_create(view);
view_set_decorations(view, has_ssd(view));
position_xdg_toplevel_view(view);
@ -357,6 +356,12 @@ xdg_toplevel_view_map(struct view *view)
}
view_moved(view);
/*
* Create toplevel handle after initial positioning to ensure
* enter event is sent to the right output
*/
foreign_toplevel_handle_create(view);
view->been_mapped = true;
}

View file

@ -491,10 +491,6 @@ map(struct view *view)
view->scene_node = &tree->node;
}
if (!view->toplevel_handle) {
foreign_toplevel_handle_create(view);
}
if (!view->been_mapped) {
view_set_decorations(view, want_deco(xwayland_surface));
@ -506,6 +502,10 @@ map(struct view *view)
view->been_mapped = true;
}
if (!view->toplevel_handle) {
foreign_toplevel_handle_create(view);
}
if (view->ssd_enabled && !view->fullscreen && !view->maximized) {
top_left_edge_boundary_check(view);
}