X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3eb1aad7ec1331a5331f03a1913156fdbed9fcc4..377d47bdf192ca070bf2ba1cbdd8c8a3589073cf:/wxPython/src/helpers.cpp diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 0c2e631e36..c05de89a4f 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -23,9 +23,17 @@ #endif #ifdef __WXGTK__ +#include +#include #include #include #include +#define GetXWindow(wxwin) GDK_WINDOW_XWINDOW((wxwin)->m_widget->window) +#endif + +#ifdef __WXX11__ +#include "wx/x11/privx.h" +#define GetXWindow(wxwin) ((Window)(wxwin)->GetHandle()) #endif #ifdef __WXMAC__ @@ -1805,22 +1813,13 @@ long wxPyGetWinHandle(wxWindow* win) { return (long)win->GetHandle(); #endif - // Find and return the actual X-Window. -#ifdef __WXGTK__ - if (win->m_wxwindow) { -#ifdef __WXGTK20__ - return (long) GDK_WINDOW_XWINDOW(GTK_PIZZA(win->m_wxwindow)->bin_window); -#else - GdkWindowPrivate* bwin = (GdkWindowPrivate*)GTK_PIZZA(win->m_wxwindow)->bin_window; - if (bwin) { - return (long)bwin->xwindow; - } -#endif - } +#if defined(__WXGTK__) || defined(__WXX11) + return (long)GetXWindow(win); #endif - + #ifdef __WXMAC__ - return (long)MAC_WXHWND(win->MacGetRootWindow()); + //return (long)MAC_WXHWND(win->MacGetTopLevelWindowRef()); + return (long)win->GetHandle(); #endif return 0;