X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/385e8575dd1f9219fb0e3f7fa26ffe4c24d2fdbb..ad653fa23069c5d9378247084f03c9a718c3ad62:/src/gtk/nativewin.cpp?ds=inline diff --git a/src/gtk/nativewin.cpp b/src/gtk/nativewin.cpp index 4ed6675a70..91cb1ce613 100644 --- a/src/gtk/nativewin.cpp +++ b/src/gtk/nativewin.cpp @@ -32,7 +32,7 @@ #include "wx/gtk/private/gtk2-compat.h" #ifdef GDK_WINDOWING_X11 - #include + #include #endif // ============================================================================ @@ -95,7 +95,15 @@ bool wxNativeContainerWindow::Create(wxNativeContainerWindowHandle win) bool wxNativeContainerWindow::Create(wxNativeContainerWindowId anid) { bool rc; +#ifdef __WXGTK3__ +#ifdef GDK_WINDOWING_X11 + GdkWindow * const win = gdk_x11_window_foreign_new_for_display(gdk_display_get_default(), anid); +#else + GdkWindow * const win = NULL; +#endif +#else GdkWindow * const win = gdk_window_foreign_new(anid); +#endif if ( win ) { rc = Create(win); @@ -117,6 +125,7 @@ void wxNativeContainerWindow::OnNativeDestroyed() // because it's a private GDK function and calling normal // gdk_window_destroy() results in X errors while nulling just the window // pointer and destroying m_widget results in many GTK errors + GTKDisconnect(m_widget); m_widget = NULL; // notice that we intentionally don't use Close() nor Delete() here as our