From 98bc3dcf46f3639269afe6f8cbe27a300f80fe8e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 14 Apr 2004 05:57:47 +0000 Subject: [PATCH] simplify how the XWindow is extracted for GetHandle git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26766 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/helpers.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 0c2e631e36..5629feac3e 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,20 +1813,10 @@ 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; - } +#if defined(__WXGTK__) || defined(__WXX11) + return (long)GetXWindow(win); #endif - } -#endif - + #ifdef __WXMAC__ return (long)MAC_WXHWND(win->MacGetRootWindow()); #endif