[gnome-control-center/gnome-3-36] keyboard: Fix behavior of "Replace" when adding custom shortcut



commit 6172c970f0ca07188c2f6e196b79985ae2cb2fed
Author: Ian Douglas Scott <idscott system76 com>
Date:   Thu Sep 17 09:54:26 2020 -0700

    keyboard: Fix behavior of "Replace" when adding custom shortcut
    
    In the shortcut editor, the "Replace" button is shown instead of "Set"
    or "Add" when there is a collision. But this executes the same code as
    "Set", so when adding a shortcut, it doesn't actually work.

 panels/keyboard/cc-keyboard-shortcut-editor.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-shortcut-editor.c b/panels/keyboard/cc-keyboard-shortcut-editor.c
index fa4d544b2..4356c1dde 100644
--- a/panels/keyboard/cc-keyboard-shortcut-editor.c
+++ b/panels/keyboard/cc-keyboard-shortcut-editor.c
@@ -66,6 +66,7 @@ struct _CcKeyboardShortcutEditor
 
 static void          command_entry_changed_cb                    (CcKeyboardShortcutEditor *self);
 static void          name_entry_changed_cb                       (CcKeyboardShortcutEditor *self);
+static void          set_button_clicked_cb                       (CcKeyboardShortcutEditor *self);
 
 G_DEFINE_TYPE (CcKeyboardShortcutEditor, cc_keyboard_shortcut_editor, GTK_TYPE_DIALOG)
 
@@ -514,9 +515,10 @@ remove_button_clicked_cb (CcKeyboardShortcutEditor *self)
 static void
 replace_button_clicked_cb (CcKeyboardShortcutEditor *self)
 {
-  update_shortcut (self);
-
-  gtk_widget_hide (GTK_WIDGET (self));
+  if (self->mode == CC_SHORTCUT_EDITOR_CREATE)
+    add_button_clicked_cb (self);
+  else
+    set_button_clicked_cb (self);
 }
 
 static void


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