[gtk+] Revert "Use gdk_screen_get_preferred_visual()"



commit d32650797854927ebfbc969cd5844e8411b2eb11
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Feb 10 22:10:36 2014 -0500

    Revert "Use gdk_screen_get_preferred_visual()"
    
    This reverts commit 30fa1426cfec1d83aab2640db06e19e104d5a5d7.
    
    See the bugs
    https://bugzilla.gnome.org/show_bug.cgi?id=724067
    https://bugzilla.gnome.org/show_bug.cgi?id=723740
    for the issues that are the reason for this revert.

 gdk/gdkwindow.c |    2 +-
 gtk/gtkwidget.c |    9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 299195d..51fc8ba 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_preferred_visual (screen);
+    window->visual = gdk_screen_get_system_visual (screen);
 
   window->event_mask = attributes->event_mask;
 
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 248bb43..0387866 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10880,9 +10880,14 @@ 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));
         }
-    }
 
-  return gdk_screen_get_preferred_visual (screen);
+  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;
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]