From 60169b7a51f096b48ac5916834aef220d4cc9e97 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Wed, 19 Jul 2006 18:59:03 +0000 Subject: [PATCH] [wxGTK] Be pessimistic about transparency being visually shown in CanSetTransparent. With current code 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 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 508e7d5ee6..1a712ae824 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -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 } -- 2.50.0