summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Douglas Scott <idscott@system76.com>2020-09-17 09:54:26 -0700
committerRobert Ancell <robert.ancell@gmail.com>2020-09-25 03:17:29 +0000
commit099426714cd2a8bc31128fb6a1c6d87478e80144 (patch)
tree99796914874afb0aa038adaf949c8c57eab38a6f
parent5c0f6e1cdee980628d2274fba2f8716dd54ab442 (diff)
downloadgnome-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.c8
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