diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/config.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c index 95d8f339..d923eea5 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -721,6 +721,24 @@ void free_sway_mouse_binding(struct sway_mouse_binding *binding) { | |||
721 | free(binding); | 721 | free(binding); |
722 | } | 722 | } |
723 | 723 | ||
724 | struct sway_binding *sway_binding_dup(struct sway_binding *sb) { | ||
725 | struct sway_binding *new_sb = malloc(sizeof(struct sway_binding)); | ||
726 | |||
727 | new_sb->order = sb->order; | ||
728 | new_sb->modifiers = sb->modifiers; | ||
729 | new_sb->command = strdup(sb->command); | ||
730 | |||
731 | new_sb->keys = create_list(); | ||
732 | int i; | ||
733 | for (i = 0; i < sb->keys->length; ++i) { | ||
734 | xkb_keysym_t *key = malloc(sizeof(xkb_keysym_t)); | ||
735 | *key = *(xkb_keysym_t *)sb->keys->items[i]; | ||
736 | list_add(new_sb->keys, key); | ||
737 | } | ||
738 | |||
739 | return new_sb; | ||
740 | } | ||
741 | |||
724 | struct bar_config *default_bar_config(void) { | 742 | struct bar_config *default_bar_config(void) { |
725 | struct bar_config *bar = NULL; | 743 | struct bar_config *bar = NULL; |
726 | bar = malloc(sizeof(struct bar_config)); | 744 | bar = malloc(sizeof(struct bar_config)); |