summaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
authorLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-05 23:18:59 +0100
committerLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-05 23:18:59 +0100
commit843e2ad2c140288733110691f7dc8252fbe4dc16 (patch)
tree3244491ed6cc45666e0599f8cbb3099864f627eb /sway/commands.c
parentAdd modifier key to bar_config json (diff)
downloadsway-843e2ad2c140288733110691f7dc8252fbe4dc16.tar.gz
sway-843e2ad2c140288733110691f7dc8252fbe4dc16.tar.zst
sway-843e2ad2c140288733110691f7dc8252fbe4dc16.zip
Only send modifier event once for active modifiers
This makes sure that a modifier event is only sent for active bar modifiers, and that it is only sent once for each of those modifiers. An active bar modifier is a modifier defined for a bar with `mode hide` and `hidden_state hide`.
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 963d8f12..3a4079e4 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -1751,6 +1751,9 @@ static struct cmd_results *bar_cmd_hidden_state(int argc, char **argv) {
1751 } 1751 }
1752 } 1752 }
1753 1753
1754 // active bar modifiers might have changed.
1755 update_active_bar_modifiers();
1756
1754 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 1757 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
1755} 1758}
1756 1759
@@ -1775,6 +1778,9 @@ static struct cmd_results *bar_set_mode(struct bar_config *bar, const char *mode
1775 if (strcmp(old_mode, bar->mode) != 0) { 1778 if (strcmp(old_mode, bar->mode) != 0) {
1776 if (!config->reading) { 1779 if (!config->reading) {
1777 ipc_event_barconfig_update(bar); 1780 ipc_event_barconfig_update(bar);
1781
1782 // active bar modifiers might have changed.
1783 update_active_bar_modifiers();
1778 } 1784 }
1779 sway_log(L_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id); 1785 sway_log(L_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id);
1780 } 1786 }