[eog] Fix arrow key behavior without collection in RTL locales



commit bab906c52f31e96e4b7311cd04fd8e92299a8791
Author: Felix Riemann <friemann gnome org>
Date:   Mon Oct 12 16:08:27 2009 +0200

    Fix arrow key behavior without collection in RTL locales
    
    Left/Right arrows are simply mapped to Up/Down. This makes sure this
    mapping gets inverted in RTL locales. Fixes bgo#566104.

 src/eog-window.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index bf3bb92..417c779 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -4672,7 +4672,15 @@ eog_window_key_press (GtkWidget *widget, GdkEventKey *event)
 		if (tbcontainer->focus_child != NULL)
 			break;
 		if (!GTK_WIDGET_VISIBLE (EOG_WINDOW (widget)->priv->nav)) {
-			eog_window_cmd_go_prev (NULL, EOG_WINDOW (widget));
+			if (is_rtl && event->keyval == GDK_Left) {
+				/* handle RTL fall-through,
+				 * need to behave like GDK_Down then */
+				eog_window_cmd_go_next (NULL,
+							EOG_WINDOW (widget));
+			} else {
+				eog_window_cmd_go_prev (NULL,
+							EOG_WINDOW (widget));
+			}
 			result = TRUE;
 			break;
 		}
@@ -4695,7 +4703,15 @@ eog_window_key_press (GtkWidget *widget, GdkEventKey *event)
 		if (tbcontainer->focus_child != NULL)
 			break;
 		if (!GTK_WIDGET_VISIBLE (EOG_WINDOW (widget)->priv->nav)) {
-			eog_window_cmd_go_next (NULL, EOG_WINDOW (widget));
+			if (is_rtl && event->keyval == GDK_Right) {
+				/* handle RTL fall-through,
+				 * need to behave like GDK_Up then */
+				eog_window_cmd_go_prev (NULL,
+							EOG_WINDOW (widget));
+			} else {
+				eog_window_cmd_go_next (NULL,
+							EOG_WINDOW (widget));
+			}
 			result = TRUE;
 			break;
 		}



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