From dd0144c3cd285cc818fb31d239c7e759d6bef823 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 4 Mar 2020 06:47:12 -0800 Subject: [PATCH] fix(bar): set exclusive zone early for gtk-layer-shell If the bar is using initial size from the config (i.e both width and height are set and resize is not required), GtkWindow configure event is is not emitted. Initialize exclusive zone earlier for that case. Fixes #609 --- src/bar.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bar.cpp b/src/bar.cpp index 7b9e930..431a564 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -175,6 +175,11 @@ void waybar::Bar::initGtkLayerShell() { gtk_layer_set_margin(gtk_window, GTK_LAYER_SHELL_EDGE_RIGHT, margins_.right); gtk_layer_set_margin(gtk_window, GTK_LAYER_SHELL_EDGE_TOP, margins_.top); gtk_layer_set_margin(gtk_window, GTK_LAYER_SHELL_EDGE_BOTTOM, margins_.bottom); + + if (width_ > 1 && height_ > 1) { + /* configure events are not emitted if the bar is using initial size */ + setExclusiveZone(width_, height_); + } } #endif