From a3912436be3aac10f97e01dcccd348e0533d8088 Mon Sep 17 00:00:00 2001 From: Calvin Chu Date: Thu, 1 Jun 2023 21:38:27 +1000 Subject: [PATCH 1/2] hyprland/window: add css class for empty label --- src/modules/hyprland/window.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/hyprland/window.cpp b/src/modules/hyprland/window.cpp index 40b6620..67631d5 100644 --- a/src/modules/hyprland/window.cpp +++ b/src/modules/hyprland/window.cpp @@ -92,6 +92,11 @@ void Window::onEvent(const std::string& ev) { if (windowName == lastView) return; lastView = windowName; + if (windowName[0] == '\0') { + label_.get_style_context()->add_class("empty"); + } else { + label_.get_style_context()->remove_class("empty"); + } spdlog::debug("hyprland window onevent with {}", windowName); From 17a56aa4f7a5058868a7dba954ff6cb32560648b Mon Sep 17 00:00:00 2001 From: Calvin Chu Date: Sat, 3 Jun 2023 12:29:36 +1000 Subject: [PATCH 2/2] hyprland/window: use empty() for empty window name check --- src/modules/hyprland/window.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/hyprland/window.cpp b/src/modules/hyprland/window.cpp index 67631d5..714d0a7 100644 --- a/src/modules/hyprland/window.cpp +++ b/src/modules/hyprland/window.cpp @@ -92,7 +92,8 @@ void Window::onEvent(const std::string& ev) { if (windowName == lastView) return; lastView = windowName; - if (windowName[0] == '\0') { + + if (windowName.empty()) { label_.get_style_context()->add_class("empty"); } else { label_.get_style_context()->remove_class("empty");