fix(tooltips): keep dynamic tooltips from resetting hover delay

Cache ALabel tooltip markup and provide it through query-tooltip instead of repeatedly setting GtkWidget's tooltip-markup property. This prevents frequently updating modules from restarting GTK's display-wide tooltip timer.

Keep the active tooltip updated directly so dynamic tooltip contents continue refreshing while the pointer remains stationary.
This commit is contained in:
Bene-Jázem B. Nobre
2026-07-20 11:20:39 -04:00
parent 456f78ecb1
commit d32e7fa86f
2 changed files with 25 additions and 1 deletions
+2
View File
@@ -4,6 +4,7 @@
#include <fmt/format.h>
#include <glibmm/markup.h>
#include <gtkmm/label.h>
#include <gtkmm/tooltip.h>
#include <json/json.h>
#include <optional>
@@ -92,6 +93,7 @@ class ALabel : public AModule {
// no collation weight, so two different icons compare equal.
std::optional<std::string> last_label_markup_;
std::optional<std::string> last_tooltip_markup_;
Glib::RefPtr<Gtk::Tooltip> active_tooltip_;
};
} // namespace waybar