Skip to content

Guess png dimention by file header#126

Open
jj1uzh wants to merge 1 commit intosagb:masterfrom
jj1uzh:png-dimention-guess-by-header
Open

Guess png dimention by file header#126
jj1uzh wants to merge 1 commit intosagb:masterfrom
jj1uzh:png-dimention-guess-by-header

Conversation

@jj1uzh
Copy link
Copy Markdown
Contributor

@jj1uzh jj1uzh commented Oct 29, 2021

Current version guesses PNG icons of some applications (e.g. Slack Desktop) to have size 1x1 because they are not in *x* directories.
Guess the size of such icons by PNG header.

@sagb
Copy link
Copy Markdown
Owner

sagb commented Nov 9, 2021

I tried to avoid reading icon content at startup, because it possibly may cause fatal delay in some cases, for example, when /usr or home mounted over nfs.
Instead, inspectIconMeta is supposed to set 1x1 to indicate unknown size. Then, selection procedure will choose this icon if no other icons are found. Then, during runtime, only if some window match this icon, loadIconContentPNG actually reads the file.
Is this approach broken?

@martinlowet
Copy link
Copy Markdown

Is this approach broken?

It sounds good, however it currently doesn't seem to work, at least not with vscodium, which stores it's icon at /usr/share/pixmaps/vscodium.png. With this PR the problem disappears.

@sagb
Copy link
Copy Markdown
Owner

sagb commented Feb 9, 2024

So, why didn't my approach work? Perhaps you had other icons for VSCodium, which AltTab chose instead of the desired one?

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.

3 participants