cursor: Update focus at various additional points

- When XDG and XWayland views are positioned (view_moved()).
- When unmanaged XWayland surfaces are mapped, unmapped, or moved.

Do not update cursor focus during an out-of-surface drag.

Along with the existing call in desktop_move_to_front(), this
should hopefully cover the majority of cases where the cursor focus
could get out-of-date, with the possible exception of layer-shell
surfaces.
This commit is contained in:
John Lindgren 2022-09-03 17:46:53 -04:00
parent 2e81cc13d4
commit 469adc46d6
3 changed files with 11 additions and 1 deletions

View file

@ -11,6 +11,7 @@ unmanaged_handle_request_configure(struct wl_listener *listener, void *data)
wlr_xwayland_surface_configure(xsurface, ev->x, ev->y, ev->width, ev->height);
if (unmanaged->node) {
wlr_scene_node_set_position(unmanaged->node, ev->x, ev->y);
cursor_update_focus(unmanaged->server);
}
}
@ -22,6 +23,7 @@ unmanaged_handle_set_geometry(struct wl_listener *listener, void *data)
struct wlr_xwayland_surface *xsurface = unmanaged->xwayland_surface;
if (unmanaged->node) {
wlr_scene_node_set_position(unmanaged->node, xsurface->x, xsurface->y);
cursor_update_focus(unmanaged->server);
}
}
@ -49,6 +51,7 @@ unmanaged_handle_map(struct wl_listener *listener, void *data)
unmanaged->server->unmanaged_tree,
xsurface->surface)->buffer->node;
wlr_scene_node_set_position(unmanaged->node, xsurface->x, xsurface->y);
cursor_update_focus(unmanaged->server);
}
static void
@ -102,6 +105,7 @@ unmanaged_handle_unmap(struct wl_listener *listener, void *data)
seat_reset_pressed(seat);
}
unmanaged->node = NULL;
cursor_update_focus(unmanaged->server);
if (seat->seat->keyboard_state.focused_surface == xsurface->surface) {
focus_next_surface(unmanaged->server, xsurface);