@@ -56,18 +56,35 @@ auto Window::update() -> void {
5656
5757 windowData_.title = windowName;
5858
59+ std::string label_text;
5960 if (!format_.empty ()) {
6061 label_.show ();
61- label_. set_markup ( waybar::util::rewriteString (
62+ label_text = waybar::util::rewriteString (
6263 fmt::format (fmt::runtime (format_), fmt::arg (" title" , windowName),
6364 fmt::arg (" initialTitle" , windowData_.initial_title ),
6465 fmt::arg (" class" , windowData_.class_name ),
6566 fmt::arg (" initialClass" , windowData_.initial_class_name )),
66- config_[" rewrite" ]));
67+ config_[" rewrite" ]);
68+ label_.set_markup (label_text);
6769 } else {
6870 label_.hide ();
6971 }
7072
73+ if (tooltipEnabled ()) {
74+ std::string tooltip_format;
75+ if (config_[" tooltip-format" ].isString ()) {
76+ tooltip_format = config_[" tooltip-format" ].asString ();
77+ }
78+ if (!tooltip_format.empty ()) {
79+ label_.set_tooltip_text (fmt::format (fmt::runtime (tooltip_format), fmt::arg (" title" , windowName),
80+ fmt::arg (" initialTitle" , windowData_.initial_title ),
81+ fmt::arg (" class" , windowData_.class_name ),
82+ fmt::arg (" initialClass" , windowData_.initial_class_name )));
83+ } else if (!label_text.empty ()){
84+ label_.set_tooltip_text (label_text);
85+ }
86+ }
87+
7188 if (focused_) {
7289 image_.show ();
7390 } else {
0 commit comments