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
This commit is contained in:
Paul Cornett
2012-04-24 05:38:12 +00:00
parent e059e1bb33
commit ee1787872d

View File

@@ -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)