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
This commit is contained in:
Aleksei Bavshin 2020-03-04 06:47:12 -08:00
parent 37b1b35035
commit dd0144c3cd
No known key found for this signature in database
GPG Key ID: 4F071603387A382A
1 changed files with 5 additions and 0 deletions

View File

@ -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