Skip to content

workaround for icons not rendered for apps existing before waybar launch - #3393

Merged
Alexays merged 1 commit into
Alexays:masterfrom
RobertMueller2:issue_3366
Jul 1, 2024
Merged

Alexays merged 1 commit into
Alexays:masterfrom
RobertMueller2:issue_3366

Conversation

@RobertMueller2

@RobertMueller2 RobertMueller2 commented Jun 30, 2024

Copy link
Copy Markdown
Contributor

This is a workaround for #3366 .

Using gdb, I can see that handle_app_id can sometimes run when tbar_->icon_themes() has 0 elements. This happens in multi output settings and can result in empty icons for apps that have been started before waybar.

It looks to me that the Tasks can be present before Taskbar::Taskbar has run, I could also confirm this by temporarily setting a bool flag in the constructor. If anyone can, I would appreciate any more detailed explanation why that is even possible, because I don't understand it at all.

With an explanation there's probably better ways to do this. :) But the code in this PR addresses this by setting the app_ids for all of the taskbar's tasks again at the end of Taskbar's constructor, leading to another icon lookup with icon_themes() available for handle_app_id.

@Alexays
Alexays merged commit 494cedb into Alexays:master Jul 1, 2024
@Alexays

Alexays commented Jul 1, 2024

Copy link
Copy Markdown
Owner

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants