Blob Blame Raw
diff -up wxPython-src-3.0.2.0/wxPython/src/helpers.cpp.getxwindowcrash wxPython-src-3.0.2.0/wxPython/src/helpers.cpp
--- wxPython-src-3.0.2.0/wxPython/src/helpers.cpp.getxwindowcrash	2014-10-13 18:37:52.000000000 -0400
+++ wxPython-src-3.0.2.0/wxPython/src/helpers.cpp	2015-01-03 22:05:35.936010783 -0500
@@ -29,9 +29,19 @@
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
 #ifdef __WXGTK3__
-#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
-                          GDK_WINDOW_XID(gtk_widget_get_window((wxwin)->m_wxwindow)) :	\
-                          GDK_WINDOW_XID(gtk_widget_get_window((wxwin)->m_widget))
+// Unlike GDK_WINDOW_XWINDOW, GDK_WINDOW_XID can't handle a NULL, so check 1st
+static XID GetXWindow(wxWindow* wxwin) {
+    if ((wxwin)->m_wxwindow) {
+        if (gtk_widget_get_window((wxwin)->m_wxwindow))
+            return GDK_WINDOW_XID(gtk_widget_get_window((wxwin)->m_wxwindow));
+        return 0;    
+    }
+    else {
+        if (gtk_widget_get_window((wxwin)->m_widget))
+            return GDK_WINDOW_XID(gtk_widget_get_window((wxwin)->m_widget));
+        return 0;
+    }
+}
 #else
 #define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
                           GDK_WINDOW_XWINDOW((wxwin)->m_wxwindow->window) : \