]> git.saurik.com Git - wxWidgets.git/commitdiff
Only send keypress events to focus widget, not its parents
authorRobert Roebling <robert@roebling.de>
Sat, 15 Sep 2007 10:29:26 +0000 (10:29 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 15 Sep 2007 10:29:26 +0000 (10:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48708 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp

index 8c8cdec0cc976a38fdc5cf9055a4b3a6f782729a..559fc2b74419b615fcbb49c15461c4ca901085cd 100644 (file)
@@ -991,6 +991,11 @@ gtk_window_key_press_callback( GtkWidget *widget,
     if (g_blockEventsOnDrag)
         return FALSE;
 
+    // GTK+ sends keypress events to the focus widget and then
+    // to all its parent and grandparent widget. We only want
+    // the key events from the focus widget.
+    if (!GTK_WIDGET_HAS_FOCUS(widget))
+        return FALSE;
 
     wxKeyEvent event( wxEVT_KEY_DOWN );
     bool ret = false;
@@ -3777,6 +3782,7 @@ void wxWindowGTK::GtkSendPaintEvents()
     nc_paint_event.SetEventObject( this );
     GetEventHandler()->ProcessEvent( nc_paint_event );
 
+    
     wxPaintEvent paint_event( GetId() );
     paint_event.SetEventObject( this );
     GetEventHandler()->ProcessEvent( paint_event );