diff options
Diffstat (limited to 'include/swaybar/bar.h')
-rw-r--r-- | include/swaybar/bar.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h index 593f4f6d..9ff3fe7b 100644 --- a/include/swaybar/bar.h +++ b/include/swaybar/bar.h | |||
@@ -50,6 +50,11 @@ struct swaybar { | |||
50 | char *mode; | 50 | char *mode; |
51 | bool mode_pango_markup; | 51 | bool mode_pango_markup; |
52 | 52 | ||
53 | // only relevant when bar is in "hide" mode | ||
54 | bool visible_by_modifier; | ||
55 | bool visible_by_urgency; | ||
56 | bool visible; | ||
57 | |||
53 | struct wl_display *display; | 58 | struct wl_display *display; |
54 | struct wl_compositor *compositor; | 59 | struct wl_compositor *compositor; |
55 | struct zwlr_layer_shell_v1 *layer_shell; | 60 | struct zwlr_layer_shell_v1 *layer_shell; |
@@ -104,6 +109,19 @@ bool bar_setup(struct swaybar *bar, const char *socket_path); | |||
104 | void bar_run(struct swaybar *bar); | 109 | void bar_run(struct swaybar *bar); |
105 | void bar_teardown(struct swaybar *bar); | 110 | void bar_teardown(struct swaybar *bar); |
106 | 111 | ||
112 | /* | ||
113 | * Determines whether the bar should be visible and changes it to be so. | ||
114 | * If the current visibility of the bar is the different to what it should be, | ||
115 | * then it adds or destroys the layer surface as required, | ||
116 | * as well as sending the cont or stop signal to the status command. | ||
117 | * If the current visibility of the bar is already what it should be, | ||
118 | * then this function is a no-op, unless moving_layer is true, which occurs | ||
119 | * when the bar changes from "hide" to "dock" mode or vice versa, and the bar | ||
120 | * needs to be destroyed and re-added in order to change its layer. | ||
121 | * | ||
122 | * Returns true if the bar is now visible, otherwise false. | ||
123 | */ | ||
124 | bool determine_bar_visibility(struct swaybar *bar, bool moving_layer); | ||
107 | void free_hotspots(struct wl_list *list); | 125 | void free_hotspots(struct wl_list *list); |
108 | void free_workspaces(struct wl_list *list); | 126 | void free_workspaces(struct wl_list *list); |
109 | 127 | ||