]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
Fix tree control invalid pointer after drag bug.
[wxWidgets.git] / src / gtk / window.cpp
index 8dfbf2b0962ba6f1ff4ac7b5b445fc45466b4b05..e6b814f0009d95c8454644a29c1538812bde2726 100644 (file)
     #include "wx/caret.h"
 #endif // wxUSE_CARET
 
+#if wxUSE_TEXTCTRL
+#include "wx/textctrl.h"
+#endif
+
 #include "wx/menu.h"
 #include "wx/statusbr.h"
 #include "wx/intl.h"
@@ -1708,6 +1712,16 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
     }
 #endif // wxUSE_CARET
 
+#if wxUSE_TEXTCTRL
+    // If it's a wxTextCtrl don't send the event as it will be done
+    // after the control gets to process it.
+    wxTextCtrl *ctrl = wxDynamicCast(win, wxTextCtrl);
+    if ( ctrl )
+    {
+        return FALSE;
+    }
+#endif
+
     if (win->IsTopLevel())
     {
         wxActivateEvent event( wxEVT_ACTIVATE, TRUE, win->GetId() );
@@ -1776,6 +1790,16 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED
     }
 #endif // wxUSE_CARET
 
+#if wxUSE_TEXTCTRL
+    // If it's a wxTextCtrl don't send the event as it will be done
+    // after the control gets to process it.
+    wxTextCtrl *ctrl = wxDynamicCast(win, wxTextCtrl);
+    if ( ctrl )
+    {
+        return FALSE;
+    }
+#endif
+
     if (win->IsTopLevel())
     {
         wxActivateEvent event( wxEVT_ACTIVATE, FALSE, win->GetId() );