core: Make "adding ignored serials" private API

This sounds unnecessary from shell code, and possibly even harmful.
Make this API private and move it into the X11 parts where it belongs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2828>
This commit is contained in:
Carlos Garnacho
2023-02-01 11:20:22 +01:00
parent 3356823ca2
commit 67a69709b9
3 changed files with 27 additions and 38 deletions

View File

@@ -2381,6 +2381,31 @@ meta_x11_display_focus_sentinel_clear (MetaX11Display *x11_display)
return (x11_display->sentinel_counter == 0);
}
static void
meta_x11_display_add_ignored_crossing_serial (MetaX11Display *x11_display,
unsigned long serial)
{
MetaDisplay *display = x11_display->display;
int i;
/* don't add the same serial more than once */
if (serial ==
display->ignored_crossing_serials[N_IGNORED_CROSSING_SERIALS - 1])
return;
/* shift serials to the left */
i = 0;
while (i < (N_IGNORED_CROSSING_SERIALS - 1))
{
display->ignored_crossing_serials[i] =
display->ignored_crossing_serials[i + 1];
++i;
}
/* put new one on the end */
display->ignored_crossing_serials[i] = serial;
}
void
meta_x11_display_set_stage_input_region (MetaX11Display *x11_display,
XserverRegion region)
@@ -2402,8 +2427,8 @@ meta_x11_display_set_stage_input_region (MetaX11Display *x11_display,
* focus-follows-mouse focus - it's not the user doing something, it's the
* environment changing under the user.
*/
meta_display_add_ignored_crossing_serial (x11_display->display,
XNextRequest (xdisplay));
meta_x11_display_add_ignored_crossing_serial (x11_display,
XNextRequest (xdisplay));
XFixesSetWindowShapeRegion (xdisplay,
x11_display->composite_overlay_window,
ShapeInput, 0, 0, region);