Commit b3158686 authored by Benjamin Otte's avatar Benjamin Otte

gtk: Simplify code for reduced screen count

parent e255cf15
......@@ -459,18 +459,13 @@ display_closed_cb (GdkDisplay *display,
{
GdkScreen *screen;
GtkSettings *settings;
gint i;
for (i = 0; i < gdk_display_get_n_screens (display); i++)
{
screen = gdk_display_get_screen (display, i);
settings = gtk_settings_get_for_screen (screen);
screen = gdk_display_get_screen (display, 0);
settings = gtk_settings_get_for_screen (screen);
g_object_set_data_full (G_OBJECT (settings),
I_("gtk-modules"),
NULL, NULL);
}
g_object_set_data_full (G_OBJECT (settings),
I_("gtk-modules"),
NULL, NULL);
}
......@@ -478,10 +473,10 @@ static void
display_opened_cb (GdkDisplayManager *display_manager,
GdkDisplay *display)
{
GValue value = G_VALUE_INIT;
GSList *slist;
GdkScreen *screen;
GtkSettings *settings;
gint i;
for (slist = gtk_modules; slist; slist = slist->next)
{
......@@ -494,20 +489,14 @@ display_opened_cb (GdkDisplayManager *display_manager,
}
}
for (i = 0; i < gdk_display_get_n_screens (display); i++)
{
GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_STRING);
g_value_init (&value, G_TYPE_STRING);
screen = gdk_display_get_screen (display, 0);
screen = gdk_display_get_screen (display, i);
if (gdk_screen_get_setting (screen, "gtk-modules", &value))
{
settings = gtk_settings_get_for_screen (screen);
_gtk_modules_settings_changed (settings, g_value_get_string (&value));
g_value_unset (&value);
}
if (gdk_screen_get_setting (screen, "gtk-modules", &value))
{
settings = gtk_settings_get_for_screen (screen);
_gtk_modules_settings_changed (settings, g_value_get_string (&value));
g_value_unset (&value);
}
/* Since closing display doesn't actually release the resources yet,
......
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