mirror of
https://github.com/swaywm/sway.git
synced 2026-04-23 06:46:27 -04:00
view: wait until surface is mapped to send enter
Based on observation, this is what weston does. I'm not sure if it's useful to send enter on surface creation before the surface is mapped, howver the wayland protocol seems to encourage it, saying explicitly enter should be send on "creation".
This commit is contained in:
parent
00b10a93f1
commit
54e3c49698
1 changed files with 5 additions and 5 deletions
|
|
@ -1063,6 +1063,11 @@ static void view_child_handle_surface_map(struct wl_listener *listener,
|
|||
wl_container_of(listener, child, surface_map);
|
||||
child->mapped = true;
|
||||
view_child_damage(child, true);
|
||||
|
||||
struct sway_workspace *workspace = child->view->container->pending.workspace;
|
||||
if (workspace) {
|
||||
wlr_surface_send_enter(child->surface, workspace->output->wlr_output);
|
||||
}
|
||||
}
|
||||
|
||||
static void view_child_handle_surface_unmap(struct wl_listener *listener,
|
||||
|
|
@ -1107,11 +1112,6 @@ void view_child_init(struct sway_view_child *child,
|
|||
wl_signal_add(&view->events.unmap, &child->view_unmap);
|
||||
child->view_unmap.notify = view_child_handle_view_unmap;
|
||||
|
||||
struct sway_workspace *workspace = child->view->container->pending.workspace;
|
||||
if (workspace) {
|
||||
wlr_surface_send_enter(child->surface, workspace->output->wlr_output);
|
||||
}
|
||||
|
||||
view_child_init_subsurfaces(child, surface);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue