x11: Reset ignored crossing serials from X11 code

They are only ever set and ignored from X11 code, we can also move
this bit of sloppy/mouse mode handling to the X11 parts.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2828>
This commit is contained in:
Carlos Garnacho 2023-02-01 11:06:11 +01:00
parent b321d545b1
commit 3356823ca2
2 changed files with 19 additions and 16 deletions

View File

@ -7395,19 +7395,6 @@ meta_window_set_opacity (MetaWindow *window,
meta_compositor_window_opacity_changed (window->display->compositor, window);
}
static void
reset_ignored_crossing_serials (MetaDisplay *display)
{
int i;
i = 0;
while (i < N_IGNORED_CROSSING_SERIALS)
{
display->ignored_crossing_serials[i] = 0;
++i;
}
}
typedef struct
{
MetaWindow *window;
@ -7593,9 +7580,6 @@ meta_window_handle_enter (MetaWindow *window,
queue_focus_callback (display, window, root_x, root_y);
else
mouse_mode_focus (window, timestamp);
/* stop ignoring stuff */
reset_ignored_crossing_serials (display);
}
break;
case G_DESKTOP_FOCUS_MODE_CLICK:

View File

@ -934,6 +934,19 @@ crossing_serial_is_ignored (MetaX11Display *x11_display,
return FALSE;
}
static void
reset_ignored_crossing_serials (MetaX11Display *x11_display)
{
int i;
i = 0;
while (i < N_IGNORED_CROSSING_SERIALS)
{
x11_display->display->ignored_crossing_serials[i] = 0;
++i;
}
}
static gboolean
handle_input_xevent (MetaX11Display *x11_display,
XIEvent *input_event,
@ -986,6 +999,12 @@ handle_input_xevent (MetaX11Display *x11_display,
enter_event->time,
enter_event->root_x,
enter_event->root_y);
if (window->type != META_WINDOW_DOCK)
{
/* stop ignoring stuff */
reset_ignored_crossing_serials (x11_display);
}
}
break;
case XI_Leave: