Skip to content

Commit

Permalink
WindowIcon: reload icon if more info about the window becomes availab…
Browse files Browse the repository at this point in the history
…le (#2068)
  • Loading branch information
leolost2605 authored Sep 23, 2024
1 parent 8928954 commit 20eef78
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/WindowIcon.vala
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ public class Gala.WindowIcon : Clutter.Actor {
}

construct {
/**
* Sometimes a WindowIcon is constructed on Meta.Display::window_created.
* In this case it can happen that we don't have any info about the app yet so we can't get the
* correct icon. Therefore we check whether the info becomes available at some point
* and if it does we try to get a new icon.
*/
window.notify["wm-class"].connect (reload_icon);
window.notify["gtk-application-id"].connect (reload_icon);

reload_icon ();
}

private void reload_icon () {
width = icon_size * scale;
height = icon_size * scale;

Expand Down

0 comments on commit 20eef78

Please sign in to comment.