Use gdk_screen_get_preferred_visual()

When creating windows, and when returning a widgets
visual, use the new API to get the preferred visual.
This commit is contained in:
Matthias Clasen 2014-02-04 13:13:52 -05:00
parent 2b95d1a34e
commit 30fa1426cf
2 changed files with 3 additions and 8 deletions

View File

@ -1332,7 +1332,7 @@ gdk_window_new (GdkWindow *parent,
if (attributes_mask & GDK_WA_VISUAL)
window->visual = attributes->visual;
else
window->visual = gdk_screen_get_system_visual (screen);
window->visual = gdk_screen_get_preferred_visual (screen);
window->event_mask = attributes->event_mask;

View File

@ -10863,14 +10863,9 @@ gtk_widget_get_visual (GtkWidget *widget)
g_warning ("Ignoring visual set on widget `%s' that is not on the correct screen.",
gtk_widget_get_name (widget));
}
}
visual = gdk_screen_get_rgba_visual (screen);
if (visual == NULL ||
g_strcmp0 (g_getenv ("GDK_RGBA"), "0") != 0)
visual = gdk_screen_get_system_visual (screen);
return visual;
return gdk_screen_get_preferred_visual (screen);
}
/**