cmd_bar improvements (#4014)

- Split cmd_bar into 2 functions, improving errors and reducing strcmps
- Only update barconfig when something has changed
- Only update barconfig for the specific bar that has changed

Fixes #3958
This commit is contained in:
Orestis Floros
2020-05-07 09:22:03 +02:00
committed by GitHub
parent 142b3fa945
commit f63a4bef54
6 changed files with 55 additions and 84 deletions

View File

@ -460,15 +460,17 @@ state BAR:
-> BAR_MODE
state BAR_HIDDEN_STATE:
bar_value = 'hide', 'show', 'toggle'
-> BAR_W_ID
state BAR_MODE:
bar_value = 'dock', 'hide', 'invisible', 'toggle'
-> BAR_W_ID
state BAR_W_ID:
bar_hidden_state = 'hide', 'show', 'toggle'
->
bar_id = word
->
end
-> call cmd_bar($bar_type, $bar_value, $bar_id)
-> call cmd_bar_hidden_state($bar_hidden_state, $bar_id)
state BAR_MODE:
bar_value = 'dock', 'hide', 'invisible', 'toggle'
->
bar_id = word
->
end
-> call cmd_bar_mode($bar_value, $bar_id)