]> www.fi.muni.cz Git - evince.git/commitdiff
[libview] Do not handle key events in EvView when it's not focused
authorCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 12 May 2009 10:19:59 +0000 (12:19 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 12 May 2009 10:19:59 +0000 (12:19 +0200)
We only handle key events in EvView even when it doesn't have the focus
if there is a popup window with the focus

libview/ev-view.c

index 60a58af8c72660903ac18a9673976260a92957d1..6b0305538c825e1185b10f959422be9e01f7a201 100644 (file)
@@ -3800,7 +3800,7 @@ ev_view_key_press_event (GtkWidget   *widget,
        if (!view->document)
                return FALSE;
 
-       if (!view->presentation) {
+       if (!GTK_WIDGET_HAS_FOCUS (widget)) {
                /* Forward key events to current focused window child */
                if (view->window_child_focus) {
                        GdkEventKey *new_event;
@@ -3815,7 +3815,12 @@ ev_view_key_press_event (GtkWidget   *widget,
 
                        return handled;
                }
-       } else if (view->presentation_state == EV_PRESENTATION_END)
+
+               return FALSE;
+       }
+
+       if (!view->presentation ||
+           view->presentation_state == EV_PRESENTATION_END)
                return gtk_bindings_activate_event (GTK_OBJECT (widget), event);