mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat(bar): add config flag to disable exclusive zone
This commit is contained in:
parent
729553d3bc
commit
7aaa3df701
@ -65,6 +65,7 @@ class Bar {
|
||||
struct waybar_output *output;
|
||||
Json::Value config;
|
||||
struct wl_surface * surface;
|
||||
bool exclusive = true;
|
||||
bool visible = true;
|
||||
bool vertical = false;
|
||||
Gtk::Window window;
|
||||
|
11
src/bar.cpp
11
src/bar.cpp
@ -409,6 +409,13 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config)
|
||||
layer_ = bar_layer::OVERLAY;
|
||||
}
|
||||
|
||||
if (config["exclusive"].isBool()) {
|
||||
exclusive = config["exclusive"].asBool();
|
||||
} else if (layer_ == bar_layer::OVERLAY) {
|
||||
// swaybar defaults: overlay mode does not reserve an exclusive zone
|
||||
exclusive = false;
|
||||
}
|
||||
|
||||
bool passthrough = false;
|
||||
if (config["passthrough"].isBool()) {
|
||||
passthrough = config["passthrough"].asBool();
|
||||
@ -492,7 +499,7 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config)
|
||||
}
|
||||
|
||||
surface_impl_->setLayer(layer_);
|
||||
surface_impl_->setExclusiveZone(true);
|
||||
surface_impl_->setExclusiveZone(exclusive);
|
||||
surface_impl_->setMargins(margins_);
|
||||
surface_impl_->setPassThrough(passthrough);
|
||||
surface_impl_->setPosition(position);
|
||||
@ -533,7 +540,7 @@ void waybar::Bar::setVisible(bool value) {
|
||||
window.set_opacity(1);
|
||||
surface_impl_->setLayer(layer_);
|
||||
}
|
||||
surface_impl_->setExclusiveZone(visible);
|
||||
surface_impl_->setExclusiveZone(exclusive && visible);
|
||||
surface_impl_->commit();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user