mirror of
https://github.com/swaywm/sway.git
synced 2025-10-29 05:40:18 -04:00
swaybar: handle mode/hidden_state changes
As well as adding the hidden_state property to the bar config struct, this commit handles barconfig_update events when the mode or hidden_state changes, and uses a new function determine_bar_visibility to hide or show the bar as required, using, respectively, destroy_layer_surface, which is also newly added, and add_layer_surface, which has been changed to allow dynamically adding the surface.
This commit is contained in:
parent
55ca16f2d8
commit
bcc61e5147
6 changed files with 127 additions and 11 deletions
|
|
@ -30,7 +30,8 @@ struct swaybar_config *init_config(void) {
|
|||
config->pango_markup = false;
|
||||
config->position = parse_position("bottom");
|
||||
config->font = strdup("monospace 10");
|
||||
config->mode = NULL;
|
||||
config->mode = strdup("dock");
|
||||
config->hidden_state = strdup("hide");
|
||||
config->sep_symbol = NULL;
|
||||
config->strip_workspace_numbers = false;
|
||||
config->binding_mode_indicator = true;
|
||||
|
|
@ -84,6 +85,7 @@ void free_config(struct swaybar_config *config) {
|
|||
free(config->status_command);
|
||||
free(config->font);
|
||||
free(config->mode);
|
||||
free(config->hidden_state);
|
||||
free(config->sep_symbol);
|
||||
for (int i = 0; i < config->bindings->length; i++) {
|
||||
struct swaybar_binding *binding = config->bindings->items[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue