diff options
author | Ian Douglas Scott <idscott@system76.com> | 2020-09-17 09:54:26 -0700 |
---|---|---|
committer | Robert Ancell <robert.ancell@gmail.com> | 2020-09-25 03:17:29 +0000 |
commit | 099426714cd2a8bc31128fb6a1c6d87478e80144 (patch) | |
tree | 99796914874afb0aa038adaf949c8c57eab38a6f | |
parent | 5c0f6e1cdee980628d2274fba2f8716dd54ab442 (diff) | |
download | gnome-control-center-099426714cd2a8bc31128fb6a1c6d87478e80144.tar.gz |
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.
-rw-r--r-- | panels/keyboard/cc-keyboard-shortcut-editor.c | 8 |
1 files 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 |