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



commit fed9b694309ccdfcf4fcfde81d9a183a31be0dc4
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 117f1e565..e53bb0140 100644
--- a/panels/keyboard/cc-keyboard-shortcut-editor.c
+++ b/panels/keyboard/cc-keyboard-shortcut-editor.c
@@ -69,6 +69,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)
 
@@ -495,9 +496,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]