[gtk+] Use gdk_screen_get_preferred_visual()
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Use gdk_screen_get_preferred_visual()
- Date: Tue, 4 Feb 2014 18:19:06 +0000 (UTC)
commit 30fa1426cfec1d83aab2640db06e19e104d5a5d7
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Feb 4 13:13:52 2014 -0500
Use gdk_screen_get_preferred_visual()
When creating windows, and when returning a widgets
visual, use the new API to get the preferred visual.
gdk/gdkwindow.c | 2 +-
gtk/gtkwidget.c | 9 ++-------
2 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 4fe70bc..5a84ccc 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -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;
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 6deeb6e..cff67a1 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -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);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]