From ee1787872dfad4da69b3cc986ee603a345f089ed Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 24 Apr 2012 05:38:12 +0000 Subject: [PATCH] Remove code to find topmost X window in SetTransparent(). The purpose of this code is unknown, but it may be intended to make WM decorations transparent. But it causes a crash when docking an AUI panel. And in my testing the decorations are transparent even without this code. Fixes #4841 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/toplevel.cpp | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 9083590a17..b55b5663a8 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -1401,28 +1401,6 @@ void wxTopLevelWindowGTK::SetWindowStyleFlag( long style ) } } -#ifdef GDK_WINDOWING_X11 -/* Get the X Window between child and the root window. - This should usually be the WM managed XID */ -static Window wxGetTopmostWindowX11(Display *dpy, Window child) -{ - Window root, parent; - Window* children; - unsigned int nchildren; - - XQueryTree(dpy, child, &root, &parent, &children, &nchildren); - XFree(children); - - while (parent != root) { - child = parent; - XQueryTree(dpy, child, &root, &parent, &children, &nchildren); - XFree(children); - } - - return child; -} -#endif // GDK_WINDOWING_X11 - bool wxTopLevelWindowGTK::SetTransparent(wxByte alpha) { GdkWindow* window = NULL; @@ -1433,11 +1411,7 @@ bool wxTopLevelWindowGTK::SetTransparent(wxByte alpha) #ifdef GDK_WINDOWING_X11 Display* dpy = GDK_WINDOW_XDISPLAY(window); - // We need to get the X Window that has the root window as the immediate parent - // and m_widget->window as a child. This should be the X Window that the WM manages and - // from which the opacity property is checked from. - Window win = wxGetTopmostWindowX11(dpy, GDK_WINDOW_XID(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) -- 2.45.2