[eog] EogScrollView: Check modifiers for all supported keyboard shortcuts



commit 3fcf3d368f664c3da275ee350cbf518d781d979b
Author: Felix Riemann <friemann gnome org>
Date:   Wed Jan 2 12:42:52 2013 +0100

    EogScrollView: Check modifiers for all supported keyboard shortcuts
    
    Especially check that no modifier key is pressed for zooming.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690931

 src/eog-scroll-view.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/src/eog-scroll-view.c b/src/eog-scroll-view.c
index d63ef25..f735952 100644
--- a/src/eog-scroll-view.c
+++ b/src/eog-scroll-view.c
@@ -1480,19 +1480,25 @@ display_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer data)
 	case GDK_KEY_plus:
 	case GDK_KEY_equal:
 	case GDK_KEY_KP_Add:
-		do_zoom = TRUE;
-		zoom = priv->zoom * priv->zoom_multiplier;
+		if (!(event->state & modifiers)) {
+			do_zoom = TRUE;
+			zoom = priv->zoom * priv->zoom_multiplier;
+		}
 		break;
 
 	case GDK_KEY_minus:
 	case GDK_KEY_KP_Subtract:
-		do_zoom = TRUE;
-		zoom = priv->zoom / priv->zoom_multiplier;
+		if (!(event->state & modifiers)) {
+			do_zoom = TRUE;
+			zoom = priv->zoom / priv->zoom_multiplier;
+		}
 		break;
 
 	case GDK_KEY_1:
-		do_zoom = TRUE;
-		zoom = 1.0;
+		if (!(event->state & modifiers)) {
+			do_zoom = TRUE;
+			zoom = 1.0;
+		}
 		break;
 
 	default:
@@ -1515,6 +1521,9 @@ display_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer data)
 	if (do_scroll)
 		scroll_by (view, xofs, yofs);
 
+	if(!do_scroll && !do_zoom)
+		return FALSE;
+
 	return TRUE;
 }
 



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