Prevent criticals when initializing a Wayland display

When we call _gdk_wayland_display_load_cursor_theme during
the initial opening of the first display, gdk_setting_get does
not work yet, since it relies on the default display/screen
being set, which only happens after open returns.
Instead, just use the screen of this display.
This commit is contained in:
Matthias Clasen 2013-05-04 16:11:00 -04:00
parent ed5ef04127
commit e61df371c9

View File

@ -650,14 +650,14 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display)
g_assert (wayland_display->shm);
g_value_init (&v, G_TYPE_INT);
if (gdk_setting_get ("gtk-cursor-theme-size", &v))
if (gdk_screen_get_setting (wayland_display->screen, "gtk-cursor-theme-size", &v))
size = g_value_get_int (&v);
else
size = 32;
g_value_unset (&v);
g_value_init (&v, G_TYPE_STRING);
if (gdk_setting_get ("gtk-cursor-theme-name", &v))
if (gdk_screen_get_setting (wayland_display->screen, "gtk-cursor-theme-name", &v))
name = g_value_get_string (&v);
else
name = "default";