summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Bachmann <tarnyko@tarnyko.net>2013-11-27 11:14:16 +0100
committerManuel Bachmann <tarnyko@tarnyko.net>2013-11-27 11:24:12 +0100
commite45ea70936ee30344b96ab99c7651fef58ebd4ff (patch)
tree361317fdc77841e4e6aaa7961fe8d1d339582b74
parentc13c74114305a28ce811f95ef4e97084b8fd2b7c (diff)
downloadgtk+-e45ea70936ee30344b96ab99c7651fef58ebd4ff.tar.gz
Fix CSD check for Win32
Win32 does not have alpha channel currently ; fix the check for this, so trying to enable CSDs on this platform will not "succeed" and crash the app anymore. Partially fixes gtk3-widget-factory.
-rw-r--r--gtk/gtkwindow.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 056260f337..29c3fccac7 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -61,6 +61,10 @@
#include "x11/gdkx.h"
#endif
+#ifdef GDK_WINDOWING_WIN32
+#include "win32/gdkwin32.h"
+#endif
+
#ifdef GDK_WINDOWING_WAYLAND
#include "wayland/gdkwayland.h"
#endif
@@ -3507,6 +3511,21 @@ gdk_window_supports_csd (GtkWindow *window)
}
#endif
+#ifdef GDK_WINDOWING_WIN32
+ if (GDK_IS_WIN32_DISPLAY (gtk_widget_get_display (widget)))
+ {
+ GdkScreen *screen;
+ GdkVisual *visual;
+
+ screen = gtk_widget_get_screen (widget);
+
+ /* We need a visual with alpha */
+ visual = gdk_screen_get_rgba_visual (screen);
+ if (!visual)
+ return FALSE;
+ }
+#endif
+
return TRUE;
}