fix: hosting-monitor classes not recheck on monitor disconnect/waybar restart
Some checks failed
Nix-Tests / nix-flake-check (push) Has been cancelled
linux / build (c++20, alpine) (push) Has been cancelled
linux / build (c++20, archlinux) (push) Has been cancelled
linux / build (c++20, debian) (push) Has been cancelled
linux / build (c++20, fedora) (push) Has been cancelled
linux / build (c++20, gentoo) (push) Has been cancelled
linux / build (c++20, opensuse) (push) Has been cancelled
freebsd / build (push) Has been cancelled
clang-format / lint (push) Has been cancelled

This commit is contained in:
2026-03-02 18:40:41 +03:00
parent 0a42b6c706
commit 23727eed8a
10 changed files with 27 additions and 50 deletions

View File

@@ -505,18 +505,6 @@ cava = dependency('libcava',
eproxy = dependency('epoxy', required: false) eproxy = dependency('epoxy', required: false)
if cava.found()
add_project_arguments('-DHAVE_LIBCAVA', language: 'cpp')
src_files += files('src/modules/cava/cavaRaw.cpp',
'src/modules/cava/cava_backend.cpp')
man_files += files('man/waybar-cava.5.scd')
if eproxy.found()
add_project_arguments('-DHAVE_LIBCAVAGLSL', language: 'cpp')
src_files += files('src/modules/cava/cavaGLSL.cpp')
endif
endif
if libgps.found() if libgps.found()
add_project_arguments('-DHAVE_LIBGPS', language: 'cpp') add_project_arguments('-DHAVE_LIBGPS', language: 'cpp')
src_files += files('src/modules/gps.cpp') src_files += files('src/modules/gps.cpp')

View File

@@ -114,7 +114,7 @@
#ifdef HAVE_LIBGPS #ifdef HAVE_LIBGPS
#include "modules/gps.hpp" #include "modules/gps.hpp"
#endif #endif
#include "modules/cava/cava_frontend.hpp" // #include "modules/cava/cava_frontend.hpp"
#include "modules/cffi.hpp" #include "modules/cffi.hpp"
#include "modules/custom.hpp" #include "modules/custom.hpp"
#include "modules/image.hpp" #include "modules/image.hpp"
@@ -339,9 +339,6 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name,
return new waybar::modules::Wireplumber(id, config_[name]); return new waybar::modules::Wireplumber(id, config_[name]);
} }
#endif #endif
if (ref == "cava") {
return waybar::modules::cava::getModule(id, config_[name]);
}
#ifdef HAVE_SYSTEMD_MONITOR #ifdef HAVE_SYSTEMD_MONITOR
if (ref == "systemd-failed-units") { if (ref == "systemd-failed-units") {
return new waybar::modules::SystemdFailedUnits(id, config_[name]); return new waybar::modules::SystemdFailedUnits(id, config_[name]);

View File

@@ -270,18 +270,10 @@ void Workspace::update(const std::string& workspace_icon) {
bool Workspace::isEmpty() const { bool Workspace::isEmpty() const {
auto ignore_list = m_workspaceManager.getIgnoredWindows(); auto ignore_list = m_workspaceManager.getIgnoredWindows();
// If there are no windows at all, the workspace is empty
if (m_windowMap.empty()) {
return true;
}
// If no windows are ignored, any window means the workspace is not empty
if (ignore_list.empty()) { if (ignore_list.empty()) {
return false; return m_windows == 0;
} }
// If there are windows but they are all ignored, consider the workspace empty
// Otherwise, check if every window in the map should be skipped (ignored)
return std::all_of( return std::all_of(
m_windowMap.begin(), m_windowMap.end(), m_windowMap.begin(), m_windowMap.end(),
[this, &ignore_list](const auto &window_repr) { return shouldSkipWindow(window_repr); }); [this, &ignore_list](const auto &window_repr) { return shouldSkipWindow(window_repr); });
@@ -308,7 +300,7 @@ void Workspace::updateTaskbar(const std::string& workspace_icon) {
} }
auto window_box = Gtk::make_managed<Gtk::Box>(Gtk::ORIENTATION_HORIZONTAL); auto window_box = Gtk::make_managed<Gtk::Box>(Gtk::ORIENTATION_HORIZONTAL);
window_box->set_tooltip_markup(window_repr.window_title); window_box->set_tooltip_text(window_repr.window_title);
window_box->get_style_context()->add_class("taskbar-window"); window_box->get_style_context()->add_class("taskbar-window");
if (window_repr.isActive) { if (window_repr.isActive) {
window_box->get_style_context()->add_class("active"); window_box->get_style_context()->add_class("active");