aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/render.c
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-10-13 11:56:56 +0100
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-10-14 13:33:12 +0100
commit4dba7c084acb6ca1c9d220f8eac918c046c199ad (patch)
treeff3a52a57ee7e8a9a3623e53422fe841afe6d124 /swaybar/render.c
parentswaybar: send signal to status when hiding or showing bar (diff)
downloadsway-4dba7c084acb6ca1c9d220f8eac918c046c199ad.tar.gz
sway-4dba7c084acb6ca1c9d220f8eac918c046c199ad.tar.zst
sway-4dba7c084acb6ca1c9d220f8eac918c046c199ad.zip
swaybar: when hiding bar, save old height to be restored upon reshow
Previously, when the bar was hidden, the height would be set to 0. This meant that if the bar was empty upon reshow, it would not render since the height was still 0, which made it seem there was a problem. Now, the height is not reset, but the width is, to indicate upon reshow that the layer surface needed reconfiguring.
Diffstat (limited to 'swaybar/render.c')
-rw-r--r--swaybar/render.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 670630cf..097eb462 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -519,7 +519,7 @@ void render_frame(struct swaybar_output *output) {
519 if (config_height >= 0 && height < (uint32_t)config_height) { 519 if (config_height >= 0 && height < (uint32_t)config_height) {
520 height = config_height; 520 height = config_height;
521 } 521 }
522 if (height != output->height) { 522 if (height != output->height || output->width == 0) {
523 // Reconfigure surface 523 // Reconfigure surface
524 zwlr_layer_surface_v1_set_size(output->layer_surface, 0, height); 524 zwlr_layer_surface_v1_set_size(output->layer_surface, 0, height);
525 if (strcmp(output->bar->config->mode, "dock") == 0) { 525 if (strcmp(output->bar->config->mode, "dock") == 0) {