summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2015-04-22 19:10:55 +0000
committerРуслан Ижбулатов <lrn1986@gmail.com>2015-04-29 21:12:13 +0000
commitd44921a152d14371dded7ce6e2c5260fd065a66b (patch)
tree772e81e341954fe3cefd925e40150786b93a3c2b /gtk
parent5271106250d27e826d6cfaab095a6f66066b0c29 (diff)
downloadgtk+-d44921a152d14371dded7ce6e2c5260fd065a66b.tar.gz
Enable RGBA windows on W32
Requires Vista and newer. * Create surfaces with cairo_win32_surface_create_with_format * Provide an rgba visual that can be distinguished from the system visual * Make rgba visual the best available visual * Enable alpha-transparency for all windows that we control * Check for appropriate cairo capabilities at configure time (W32 - 1.14.3 newer than 2015-04-14; others - 1.14.0) * Check for composition support before enabling CSDs * Re-enable transparency on WM_DWMCOMPOSITIONCHANGED Windows that were created while composition was enabled and that were CSDed as a result and will look ugly (thick black borders or no borders at all) once composition is disabled. If composition is enabled afterwards, they will return back to normal. This happens, for example, when RDP session is opened to a desktop where a GTK application is running. For W7/Vista windows will only re-gain transparency after the RDP session is closed. For W8 transparency will only be gone momentarily. Windows that were created while composition was disabled will not be CSDed automatically and will use SSD (WM decorations), while windows that are CSDed manually will get a thin square border. If composition is enabled afterwards, these windows will not change. This is most noticeable for system menus (popup menus are often generated on the fly, system menus are created once) and some dialogues (About dialogue, for example). https://bugzilla.gnome.org/show_bug.cgi?id=727316
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkwindow.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 71d0ffe6c2..5a57b775f5 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4043,6 +4043,9 @@ gtk_window_supports_client_shadow (GtkWindow *window)
screen = gtk_widget_get_screen (widget);
+ if (!gdk_screen_is_composited (screen))
+ return FALSE;
+
/* We need a visual with alpha */
visual = gdk_screen_get_rgba_visual (screen);
if (!visual)