X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07e497070e5666bf25e0f3616b853399b8b86c48..6890c56e85899e50e18cdb6a4ed0905eddb396cc:/src/gtk/toplevel.cpp diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 508e7d5ee6..bf4cec07be 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -1325,7 +1325,7 @@ static Window wxGetTopmostWindowX11(Display *dpy, Window child) bool wxTopLevelWindowGTK::SetTransparent(wxByte alpha) { - if (!m_widget || !m_widget->window || !CanSetTransparent()) + if (!m_widget || !m_widget->window) return false; Display* dpy = GDK_WINDOW_XDISPLAY (m_widget->window); @@ -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 }