fix(hyprland/workspaces): respect enable-bar-scroll config option

Removed hasScrollConfig boolean variable in Workspaces init function. It
was Or'd with barScroll boolean variable and overriding it when
enable-bar-scroll is declared false in waybar config. Setting any scroll
up or down events caused enable-bar-scroll to be overwritten.

Tested on Arch/Hyprland, removing hasScrollConfig and the or condition
restored expected behavior.

Fixes #5229
This commit is contained in:
Brian Brown
2026-07-31 22:27:44 -04:00
parent d44a27af10
commit d01f1f44ec
+2 -2
View File
@@ -55,8 +55,8 @@ void Workspaces::init() {
if (m_scrollEventConnection_.connected()) { if (m_scrollEventConnection_.connected()) {
m_scrollEventConnection_.disconnect(); m_scrollEventConnection_.disconnect();
} }
bool hasScrollConfig = config_["on-scroll-up"].isString() || config_["on-scroll-down"].isString();
if (barScroll() || hasScrollConfig) { if (barScroll()) {
auto& window = const_cast<Bar&>(m_bar).window; auto& window = const_cast<Bar&>(m_bar).window;
window.add_events(Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK); window.add_events(Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK);
m_scrollEventConnection_ = m_scrollEventConnection_ =