[gimp/metadata-browser] Bug 677262 - move the layer with the arrow keys, broken after...
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] Bug 677262 - move the layer with the arrow keys, broken after...
- Date: Thu, 13 Sep 2012 00:23:36 +0000 (UTC)
commit adb101bc9b23aa88abb0136e298086154b7bdfa6
Author: Michael Natterer <mitch gimp org>
Date: Fri Jun 8 00:21:07 2012 +0200
Bug 677262 - move the layer with the arrow keys, broken after...
commit 9ce8d4fae2f63576828f80dc156e2fb05f34d510. Fix the return_val
logic added in that commit, and make sure we always swallow arroy key
events, because we don't want focus keynav away from the canvas.
app/display/gimpdisplayshell-tool-events.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-tool-events.c b/app/display/gimpdisplayshell-tool-events.c
index 221a4e2..ae46e8b 100644
--- a/app/display/gimpdisplayshell-tool-events.c
+++ b/app/display/gimpdisplayshell-tool-events.c
@@ -998,19 +998,25 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
switch (kevent->keyval)
{
+ gboolean arrow_key = FALSE;
+
+ case GDK_KEY_Left:
+ case GDK_KEY_Right:
+ case GDK_KEY_Up:
+ case GDK_KEY_Down:
+ arrow_key = TRUE;
+
case GDK_KEY_Return:
case GDK_KEY_KP_Enter:
case GDK_KEY_ISO_Enter:
case GDK_KEY_BackSpace:
case GDK_KEY_Escape:
- case GDK_KEY_Left:
- case GDK_KEY_Right:
- case GDK_KEY_Up:
- case GDK_KEY_Down:
- if (gimp_image_is_empty (image) ||
- ! tool_manager_key_press_active (gimp,
- kevent,
- display))
+ if (! gimp_image_is_empty (image))
+ return_val = tool_manager_key_press_active (gimp,
+ kevent,
+ display);
+
+ if (! return_val)
{
GimpController *keyboard = gimp_controllers_get_keyboard (gimp);
@@ -1019,6 +1025,10 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
gimp_controller_keyboard_key_press (GIMP_CONTROLLER_KEYBOARD (keyboard),
kevent);
}
+
+ /* always swallow arrow keys, we don't want focus keynav */
+ if (! return_val)
+ return_val = arrow_key;
break;
case GDK_KEY_space:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]