cursor: Allow leave/enter events within the same XDG toplevel

Attempting to open a GTK3 menu and activate a menu item in it,
using a single mouse motion (press-move-release), was broken due
to GTK apparently expecting to receive leave/enter events when the
cursor enters the menu (XDG popup).

To fix the issue, allow leave/enter events when the cursor is
moved between an XDG toplevel and popups of the same.

v2:
 - Use (struct view *) as proxy for toplevel in comparisons
 - Update seat->pressed.surface when entering/leaving popups
v3:
 - Go back to using get_toplevel() rather than (struct view *)
This commit is contained in:
John Lindgren 2022-09-10 01:57:39 -04:00
parent a8fbe1aac2
commit e18f7a32ba
3 changed files with 70 additions and 14 deletions

View file

@ -115,6 +115,7 @@ struct seat {
struct view *view;
struct wlr_scene_node *node;
struct wlr_surface *surface;
struct wlr_surface *toplevel;
} pressed;
struct wl_client *active_client_while_inhibited;
@ -563,7 +564,8 @@ void seat_reconfigure(struct server *server);
void seat_focus_surface(struct seat *seat, struct wlr_surface *surface);
void seat_set_focus_layer(struct seat *seat, struct wlr_layer_surface_v1 *layer);
void seat_set_pressed(struct seat *seat, struct view *view,
struct wlr_scene_node *node, struct wlr_surface *surface);
struct wlr_scene_node *node, struct wlr_surface *surface,
struct wlr_surface *toplevel);
void seat_reset_pressed(struct seat *seat);
void interactive_begin(struct view *view, enum input_mode mode,