[evince] [libview] Do not handle key events in EvView when it's not focused



commit c22efad906911b3af9dbad0b7a422ad5bdcdf635
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Tue May 12 12:19:59 2009 +0200

    [libview] Do not handle key events in EvView when it's not focused
    
    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 |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libview/ev-view.c b/libview/ev-view.c
index 60a58af..6b03055 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -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);
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]