mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
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:
parent
3356823ca2
commit
67a69709b9
@ -1287,38 +1287,6 @@ meta_display_get_current_time_roundtrip (MetaDisplay *display)
|
||||
return meta_x11_display_get_current_time_roundtrip (display->x11_display);
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_display_add_ignored_crossing_serial:
|
||||
* @display: a #MetaDisplay
|
||||
* @serial: the serial to ignore
|
||||
*
|
||||
* Save the specified serial and ignore crossing events with that
|
||||
* serial for the purpose of focus-follows-mouse. This can be used
|
||||
* for certain changes to the window hierarchy that we don't want
|
||||
* to change the focus window, even if they cause the pointer to
|
||||
* end up in a new window.
|
||||
*/
|
||||
void
|
||||
meta_display_add_ignored_crossing_serial (MetaDisplay *display,
|
||||
unsigned long serial)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* don't add the same serial more than once */
|
||||
if (display->ignored_crossing_serials[N_IGNORED_CROSSING_SERIALS-1] == serial)
|
||||
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;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
window_raise_with_delay_callback (void *data)
|
||||
{
|
||||
|
@ -168,10 +168,6 @@ META_EXPORT
|
||||
GSList *meta_display_sort_windows_by_stacking (MetaDisplay *display,
|
||||
GSList *windows);
|
||||
|
||||
META_EXPORT
|
||||
void meta_display_add_ignored_crossing_serial (MetaDisplay *display,
|
||||
unsigned long serial);
|
||||
|
||||
META_EXPORT
|
||||
void meta_display_clear_mouse_mode (MetaDisplay *display);
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user