Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the window icon #69

Closed
tomaka opened this issue Nov 3, 2016 · 7 comments · Fixed by #497
Closed

Setting the window icon #69

tomaka opened this issue Nov 3, 2016 · 7 comments · Fixed by #497
Assignees
Labels
C - in progress Implementation is proceeding smoothly D - hard Likely harder than most tasks here DS - windows DS - x11 P - normal Great to have S - api Design and usability S - enhancement Wouldn't this be the coolest?

Comments

@tomaka
Copy link
Contributor

tomaka commented Nov 3, 2016

Original: rust-windowing/glutin#771

@tomaka tomaka added the S - api Design and usability label Nov 3, 2016
@sjaustirni
Copy link

Hi!
I am wondering, has anything been made in this matter? Is there at least an API people could start implementing?

@isavegas
Copy link

isavegas commented Sep 1, 2017

Perhaps the best way to handle it would be a feature flag that uses a crate like image and abstracts the icon assignment for whatever window manager you're using. Of course, anything that requires an external image file would require saving to the file at runtime or a build.rs for it, but it should be possible.

@icefoxen
Copy link
Contributor

I'd probably make some sort of system that just takes a simple RGBA bitmap in the form of a &[u8] and turns it into whatever platform-specific format is necessary. It's a bit of a hack I expect but hopefully a very simple hack...

@francesca64
Copy link
Member

I plan on using WindowBuilderExt and WindowExt for this, since 1) it only seems relevant on Windows and X11, and 2) X11 wants ARGB while Windows wants paths (and is picky about what it accepts).

window-icon

Implementing this on X11 will most likely be trivial.

@icefoxen
Copy link
Contributor

icefoxen commented Apr 27, 2018 via email

@francesca64
Copy link
Member

To be honest, my main rationale was that the docs for CreateIcon looked intimidating. Since you asked, I gave it a shot today, and it was actually pretty easy.

So, now I can provide a consistent API that expects RGBA. I'll also include an example program that demonstrates how to use image to set the icon using any image file.

@francesca64
Copy link
Member

PR is up: #497

@francesca64 francesca64 added S - enhancement Wouldn't this be the coolest? DS - windows DS - x11 C - in progress Implementation is proceeding smoothly D - hard Likely harder than most tasks here P - normal Great to have labels May 6, 2018
@francesca64 francesca64 self-assigned this May 6, 2018
tmfink pushed a commit to tmfink/winit that referenced this issue Jan 5, 2022
tmfink pushed a commit to tmfink/winit that referenced this issue Jan 5, 2022
tmfink pushed a commit to tmfink/winit that referenced this issue Jan 5, 2022
madsmtm pushed a commit to madsmtm/winit that referenced this issue Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - in progress Implementation is proceeding smoothly D - hard Likely harder than most tasks here DS - windows DS - x11 P - normal Great to have S - api Design and usability S - enhancement Wouldn't this be the coolest?
Development

Successfully merging a pull request may close this issue.

5 participants