From 4b7b2e64ef605a05fa7d27f09da3f8ce8a6b90cb Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 8 Oct 2022 13:36:46 +0300 Subject: [PATCH 24/24] gtk: Don't gobble + modified keys in edit mode See osdn #45802 Signed-off-by: Marko Lindqvist --- client/gui-gtk-2.0/editgui.c | 10 ++++++---- client/gui-gtk-3.0/editgui.c | 10 ++++++---- client/gui-gtk-3.22/editgui.c | 10 ++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/client/gui-gtk-2.0/editgui.c b/client/gui-gtk-2.0/editgui.c index 6aab46655e..0cfac97293 100644 --- a/client/gui-gtk-2.0/editgui.c +++ b/client/gui-gtk-2.0/editgui.c @@ -1636,14 +1636,16 @@ gboolean handle_edit_key_press(GdkEventKey *ev) { enum editor_tool_type ett, new_ett = NUM_EDITOR_TOOL_TYPES; - if (ev->state & GDK_SHIFT_MASK) { - return handle_edit_key_press_with_shift(ev); - } - + /* Check ctrl before shift - this is correct also for the case where + * they are both active. */ if (ev->state & GDK_CONTROL_MASK) { return handle_edit_key_press_with_ctrl(ev); } + if (ev->state & GDK_SHIFT_MASK) { + return handle_edit_key_press_with_shift(ev); + } + ett = editor_get_tool(); switch (ev->keyval) { diff --git a/client/gui-gtk-3.0/editgui.c b/client/gui-gtk-3.0/editgui.c index 0be8b2da93..0c918973b6 100644 --- a/client/gui-gtk-3.0/editgui.c +++ b/client/gui-gtk-3.0/editgui.c @@ -1662,14 +1662,16 @@ gboolean handle_edit_key_press(GdkEventKey *ev) { enum editor_tool_type ett, new_ett = NUM_EDITOR_TOOL_TYPES; - if (ev->state & GDK_SHIFT_MASK) { - return handle_edit_key_press_with_shift(ev); - } - + /* Check ctrl before shift - this is correct also for the case where + * they are both active. */ if (ev->state & GDK_CONTROL_MASK) { return handle_edit_key_press_with_ctrl(ev); } + if (ev->state & GDK_SHIFT_MASK) { + return handle_edit_key_press_with_shift(ev); + } + ett = editor_get_tool(); switch (ev->keyval) { diff --git a/client/gui-gtk-3.22/editgui.c b/client/gui-gtk-3.22/editgui.c index ee4f54951f..d3e4d320fc 100644 --- a/client/gui-gtk-3.22/editgui.c +++ b/client/gui-gtk-3.22/editgui.c @@ -1661,14 +1661,16 @@ gboolean handle_edit_key_press(GdkEventKey *ev) { enum editor_tool_type ett, new_ett = NUM_EDITOR_TOOL_TYPES; - if (ev->state & GDK_SHIFT_MASK) { - return handle_edit_key_press_with_shift(ev); - } - + /* Check ctrl before shift - this is correct also for the case where + * they are both active. */ if (ev->state & GDK_CONTROL_MASK) { return handle_edit_key_press_with_ctrl(ev); } + if (ev->state & GDK_SHIFT_MASK) { + return handle_edit_key_press_with_shift(ev); + } + ett = editor_get_tool(); switch (ev->keyval) { -- 2.35.1