]> git.saurik.com Git - wxWidgets.git/commitdiff
[wxGTK] Be pessimistic about transparency being visually shown in CanSetTransparent...
authorMart Raudsepp <leio@gentoo.org>
Wed, 19 Jul 2006 18:59:03 +0000 (18:59 +0000)
committerMart Raudsepp <leio@gentoo.org>
Wed, 19 Jul 2006 18:59:03 +0000 (18:59 +0000)
CanSetTransparent will only return TRUE if gtk+ version is at least 2.10 AND there is a running compositing
manager that implements the _NET_WM_CM_Sn EWMH spec addition proposal (at this point only metacity GL based
compositor, afaik). This is for wxAUI to be able to implement dock preview correctly. In general these behaviours
needs some discussion.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40193 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/toplevel.cpp

index 508e7d5ee6255bd7c2f5c9c8aafabc67eb07883c..1a712ae824d266fe3cb5605013c0c8f25af5ec91 100644 (file)
@@ -1349,8 +1349,22 @@ bool wxTopLevelWindowGTK::SetTransparent(wxByte alpha)
 
 bool wxTopLevelWindowGTK::CanSetTransparent()
 {
+#if GTK_CHECK_VERSION(2,10,0)
+    if (!gtk_check_version(2,10,0))
+    {
+        if (gtk_widget_is_composited (m_widget))
+            return true;
+    }
+    else
+#endif // In case of lower versions than gtk+-2.10.0 we could look for _NET_WM_CM_Sn ourselves
+    {
+        return false;
+    }
+
+#if 0 // Don't be optimistic here for the sake of wxAUI
     int opcode, event, error;
     // Check for the existence of a RGBA visual instead?
     return XQueryExtension(gdk_x11_get_default_xdisplay (),
                            "Composite", &opcode, &event, &error);
+#endif
 }