JWM icon indicating copy to clipboard operation
JWM copied to clipboard

Set App Icon from Pixels

Open tonsky opened this issue 4 years ago • 2 comments

Follow up to #95

  • [ ] Windows
  • [ ] Linux
  • [ ] macOS

tonsky avatar Aug 25 '21 15:08 tonsky

Currently looking into this, as part of trying to get general app icons for Linux. For that, there are, as far as I can tell, two approaches:

  • have a globally-installed the-app.desktop file describing the program and its icon location (and the app setting a WM_CLASS hint to associate to it); seems impossible to make work via just setIcon, but would be good to have as a WindowX11-only thing for those wanting to do proper X11 application association;
  • set via pixels; this could be bound to setIcon, but means something has to decode the png (or whatever file format).

I have both WM_CLASS configuring and icon-from-pixels configuring for X11 here via a temporary interface, using Skija to decode the png in the dashboard example. (the class isn't used by the example, but e.g. an OS-global icon theme could now set a custom icon for it)

dzaima avatar Sep 24 '24 16:09 dzaima

Both look good, make a PR?

I understand that setting icon is more of a packaging problem and probably can’t be easily solved by just doing API calls, but where it can work I don’t see why not have it

tonsky avatar Sep 27 '24 10:09 tonsky