File tree 1 file changed +31
-1
lines changed
1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -382,9 +382,39 @@ std::string Task::state_string(bool shortened) const {
382
382
return res.substr (0 , res.size () - 1 );
383
383
}
384
384
385
- void Task::handle_title (const char *title) {
385
+ void Task::handle_title (const char * title) {
386
+ if (title_.empty ()) {
387
+ spdlog::debug (fmt::format (" Task ({}) setting title to {}" , id_, title_));
388
+ } else {
389
+ spdlog::debug (fmt::format (" Task ({}) overwriting title '{}' with '{}'" , id_, title_, title));
390
+ }
386
391
title_ = title;
387
392
hide_if_ignored ();
393
+
394
+ if (!with_icon_ && !with_name_ || app_info_) {
395
+ return ;
396
+ }
397
+
398
+ set_app_info_from_app_id_list (title_);
399
+ name_ = app_info_ ? app_info_->get_display_name () : title;
400
+
401
+ if (!with_icon_) {
402
+ return ;
403
+ }
404
+
405
+ int icon_size = config_[" icon-size" ].isInt () ? config_[" icon-size" ].asInt () : 16 ;
406
+ bool found = false ;
407
+ for (auto &icon_theme : tbar_->icon_themes ()) {
408
+ if (image_load_icon (icon_, icon_theme, app_info_, icon_size)) {
409
+ found = true ;
410
+ break ;
411
+ }
412
+ }
413
+
414
+ if (found)
415
+ icon_.show ();
416
+ else
417
+ spdlog::debug (" Couldn't find icon for {}" , title_);
388
418
}
389
419
390
420
void Task::set_minimize_hint () {
You can’t perform that action at this time.
0 commit comments