Skip to content

Commit

Permalink
Set icon also as big winit window icon for increased compatibility.
Browse files Browse the repository at this point in the history
Under Windows, the big icon is shown at least in the ancient Alt+Tab dialog, which can be restored via registry tweak.
  • Loading branch information
Enyium committed Oct 3, 2024
1 parent fd29930 commit cb315eb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/backends/winit/winitwindowadapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::rc::Weak;

#[cfg(target_arch = "wasm32")]
use winit::platform::web::WindowExtWebSys;
use winit::platform::windows::WindowExtWindows;

use crate::renderer::WinitCompatibleRenderer;
use const_field_offset::FieldOffsets;
Expand Down Expand Up @@ -135,7 +136,10 @@ impl WinitWindowOrNone {

fn set_window_icon(&self, icon: Option<winit::window::Icon>) {
match self {
Self::HasWindow(window) => window.set_window_icon(icon),
Self::HasWindow(window) => {
window.set_window_icon(icon.as_ref().cloned());
window.set_taskbar_icon(icon);
}
Self::None(attributes) => attributes.borrow_mut().window_icon = icon,
}
}
Expand Down

0 comments on commit cb315eb

Please sign in to comment.