mirror of
https://github.com/brl/mutter.git
synced 2025-07-03 09:43:18 +00:00
x11: Move focus sentinel to MetaX11Display
This focus sentinel is a mechanism to avoid some X11-specific race conditions in focus-follows-pointer, using X11 mechanisms. Move it to MetaX11Display altogether. https://gitlab.gnome.org/GNOME/mutter/merge_requests/420
This commit is contained in:

committed by
Jonas Ådahl

parent
439afb3f19
commit
0200f4fcd9
@ -683,7 +683,6 @@ meta_display_open (void)
|
||||
}
|
||||
|
||||
display->current_time = META_CURRENT_TIME;
|
||||
display->sentinel_counter = 0;
|
||||
|
||||
display->grab_resize_timeout_id = 0;
|
||||
display->grab_have_keyboard = FALSE;
|
||||
@ -2490,37 +2489,6 @@ prefs_changed_callback (MetaPreference pref,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_display_increment_focus_sentinel (MetaDisplay *display)
|
||||
{
|
||||
unsigned long data[1];
|
||||
|
||||
data[0] = meta_display_get_current_time (display);
|
||||
|
||||
XChangeProperty (display->x11_display->xdisplay,
|
||||
display->x11_display->xroot,
|
||||
display->x11_display->atom__MUTTER_SENTINEL,
|
||||
XA_CARDINAL,
|
||||
32, PropModeReplace, (guchar*) data, 1);
|
||||
|
||||
display->sentinel_counter += 1;
|
||||
}
|
||||
|
||||
void
|
||||
meta_display_decrement_focus_sentinel (MetaDisplay *display)
|
||||
{
|
||||
display->sentinel_counter -= 1;
|
||||
|
||||
if (display->sentinel_counter < 0)
|
||||
display->sentinel_counter = 0;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_display_focus_sentinel_clear (MetaDisplay *display)
|
||||
{
|
||||
return (display->sentinel_counter == 0);
|
||||
}
|
||||
|
||||
void
|
||||
meta_display_sanity_check_timestamps (MetaDisplay *display,
|
||||
guint32 timestamp)
|
||||
|
Reference in New Issue
Block a user