fix race between fetching owner of composit selection, and
registering as a listener for changes; bug#594913
This commit is contained in:
@ -989,8 +989,6 @@ _gdk_x11_screen_new (GdkDisplay *display,
|
||||
screen_x11->wmspec_check_window = None;
|
||||
/* we want this to be always non-null */
|
||||
screen_x11->window_manager_name = g_strdup ("unknown");
|
||||
screen_x11->cm_selection_atom = make_cm_atom (screen_number);
|
||||
screen_x11->is_composited = check_is_composited (display, screen_x11);
|
||||
|
||||
init_multihead (screen);
|
||||
init_randr_support (screen);
|
||||
@ -1001,6 +999,22 @@ _gdk_x11_screen_new (GdkDisplay *display,
|
||||
return screen;
|
||||
}
|
||||
|
||||
/*
|
||||
* It is important that we first request the selection
|
||||
* notification, and then setup the initial state of
|
||||
* is_composited to avoid a race condition here.
|
||||
*/
|
||||
void
|
||||
_gdk_x11_screen_setup (GdkScreen *screen)
|
||||
{
|
||||
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
|
||||
|
||||
screen_x11->cm_selection_atom = make_cm_atom (screen_x11->screen_num);
|
||||
gdk_display_request_selection_notification (screen_x11->display,
|
||||
screen_x11->cm_selection_atom);
|
||||
screen_x11->is_composited = check_is_composited (screen_x11->display, screen_x11);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_screen_is_composited:
|
||||
* @screen: a #GdkScreen
|
||||
|
||||
Reference in New Issue
Block a user