-#ifdef __WXGTK24__
- if ( (styleChanges & wxSTAY_ON_TOP) && !gtk_check_version(2,4,0) )
- gtk_window_set_keep_above(GTK_WINDOW(m_widget), m_windowStyle & wxSTAY_ON_TOP);
-#endif // GTK+ 2.4
-#if GTK_CHECK_VERSION(2,2,0)
- if ( (styleChanges & wxFRAME_NO_TASKBAR) && !gtk_check_version(2,2,0) )
+ if ( styleChanges & wxSTAY_ON_TOP )
+ {
+ gtk_window_set_keep_above(GTK_WINDOW(m_widget),
+ m_windowStyle & wxSTAY_ON_TOP);
+ }
+
+ if ( styleChanges & wxFRAME_NO_TASKBAR )
+ {
+ gtk_window_set_skip_taskbar_hint(GTK_WINDOW(m_widget),
+ m_windowStyle & wxFRAME_NO_TASKBAR);
+ }
+}
+
+bool wxTopLevelWindowGTK::SetTransparent(wxByte alpha)
+{
+ GdkWindow* window = NULL;
+ if (m_widget)
+ window = gtk_widget_get_window(m_widget);
+ if (window == NULL)
+ return false;
+
+#ifdef GDK_WINDOWING_X11
+ Display* dpy = GDK_WINDOW_XDISPLAY(window);
+ Window win = GDK_WINDOW_XID(window);
+
+ // Using pure Xlib to not have a GTK version check mess due to gtk2.0 not having GdkDisplay
+ if (alpha == 0xff)
+ XDeleteProperty(dpy, win, XInternAtom(dpy, "_NET_WM_WINDOW_OPACITY", False));
+ else
+ {
+ long opacity = alpha * 0x1010101L;
+ XChangeProperty(dpy, win, XInternAtom(dpy, "_NET_WM_WINDOW_OPACITY", False),
+ XA_CARDINAL, 32, PropModeReplace,
+ (unsigned char *) &opacity, 1L);
+ }
+ XSync(dpy, False);
+ return true;
+#else // !GDK_WINDOWING_X11
+ return false;
+#endif // GDK_WINDOWING_X11 / !GDK_WINDOWING_X11
+}
+
+bool wxTopLevelWindowGTK::CanSetTransparent()
+{
+ // allow to override automatic detection as it's far from perfect
+ const wxString SYSOPT_TRANSPARENT = "gtk.tlw.can-set-transparent";
+ if ( wxSystemOptions::HasOption(SYSOPT_TRANSPARENT) )
+ {
+ return wxSystemOptions::GetOptionInt(SYSOPT_TRANSPARENT) != 0;
+ }
+
+#ifdef __WXGTK3__
+ return gtk_widget_is_composited(m_widget) != 0;
+#else
+#if GTK_CHECK_VERSION(2,10,0)
+ if (!gtk_check_version(2,10,0))
+ {
+ return gtk_widget_is_composited(m_widget) != 0;
+ }
+ else
+#endif // In case of lower versions than gtk+-2.10.0 we could look for _NET_WM_CM_Sn ourselves