From 099426714cd2a8bc31128fb6a1c6d87478e80144 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 17 Sep 2020 09:54:26 -0700 Subject: [PATCH] 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 0a4b623ac..75f505c34 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) @@ -485,9 +486,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