aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-20 11:32:07 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-20 11:34:57 -0500
commit9e0595f26bcca2a4d0aa735c4cd9fc4f792918bf (patch)
tree1417f4b913875db24efc5418481ab057679680cd /sway/config.c
parentMerge pull request #1571 from acrisci/wlroots-modifiers-update (diff)
downloadsway-9e0595f26bcca2a4d0aa735c4cd9fc4f792918bf.tar.gz
sway-9e0595f26bcca2a4d0aa735c4cd9fc4f792918bf.tar.zst
sway-9e0595f26bcca2a4d0aa735c4cd9fc4f792918bf.zip
input config handler context
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sway/config.c b/sway/config.c
index 5ec45b17..54357625 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -54,6 +54,8 @@ static void free_mode(struct sway_mode *mode) {
54} 54}
55 55
56void free_config(struct sway_config *config) { 56void free_config(struct sway_config *config) {
57 config_clear_handler_context(config);
58
57 int i; 59 int i;
58 60
59 if (!config) { 61 if (!config) {
@@ -480,6 +482,11 @@ bool load_include_configs(const char *path, struct sway_config *config) {
480 return true; 482 return true;
481} 483}
482 484
485void config_clear_handler_context(struct sway_config *config) {
486 free_input_config(config->handler_context.input_config);
487
488 memset(&config->handler_context, 0, sizeof(config->handler_context));
489}
483 490
484bool read_config(FILE *file, struct sway_config *config) { 491bool read_config(FILE *file, struct sway_config *config) {
485 bool success = true; 492 bool success = true;
@@ -592,8 +599,6 @@ bool read_config(FILE *file, struct sway_config *config) {
592 599
593 case CMD_BLOCK_INPUT: 600 case CMD_BLOCK_INPUT:
594 wlr_log(L_DEBUG, "End of input block"); 601 wlr_log(L_DEBUG, "End of input block");
595 free_input_config(current_input_config);
596 current_input_config = NULL;
597 block = CMD_BLOCK_END; 602 block = CMD_BLOCK_END;
598 break; 603 break;
599 604
@@ -635,6 +640,7 @@ bool read_config(FILE *file, struct sway_config *config) {
635 640
636 default:; 641 default:;
637 } 642 }
643 config_clear_handler_context(config);
638 default:; 644 default:;
639 } 645 }
640 free(line); 646 free(line);