Commit e09cf697 authored by Cosimo Cecchi's avatar Cosimo Cecchi

gdk: only emit display-opened after the default display has been set

This avoids a case where the display has been opened, but calling
gdk_display_get_default() in the callback doesn't work.
Reviewed-by: Benjamin Otte's avatarBenjamin Otte <>
parent 7cf19c8e
......@@ -1459,7 +1459,6 @@ _gdk_x11_display_open (const gchar *display_name)
_gdk_x11_screen_setup (display_x11->screens[i]);
g_signal_emit_by_name (display, "opened");
g_signal_emit_by_name (gdk_display_manager_get (), "display-opened", display);
return display;
......@@ -51,8 +51,13 @@ gdk_x11_display_manager_open_display (GdkDisplayManager *manager,
GdkDisplay *display;
display = _gdk_x11_display_open (name);
if (manager_x11->default_display == NULL && display != NULL)
gdk_display_manager_set_default_display (manager, display);
if (display != NULL)
if (manager_x11->default_display == NULL)
gdk_display_manager_set_default_display (manager, display);
g_signal_emit_by_name (manager, "display-opened", display);
return display;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment