Skip to content

OSX: Default fullscreen-borderless window size is wrong? #2087

@FredrikNoren

Description

@FredrikNoren

Hi,

Maybe I'm missing something, but this code:

let event_loop = EventLoop::new();
let window = WindowBuilder::new()
    .with_fullscreen(Some(Fullscreen::Borderless(None)))
    .build(&event_loop).unwrap();
for res in window.primary_monitor().unwrap().video_modes() {
    println!("available: {:?}", res.size());
}
println!("current: {:?}", window.inner_size());

Outputs:

available: PhysicalSize { width: 800, height: 600 }
available: PhysicalSize { width: 840, height: 525 }
available: PhysicalSize { width: 1024, height: 768 }
available: PhysicalSize { width: 1152, height: 720 }
available: PhysicalSize { width: 1280, height: 800 }
available: PhysicalSize { width: 1440, height: 900 }
available: PhysicalSize { width: 1650, height: 1050 }
available: PhysicalSize { width: 2048, height: 1280 }
available: PhysicalSize { width: 2560, height: 1600 }
available: PhysicalSize { width: 640, height: 480 }

current: PhysicalSize { width: 2880, height: 1694 }

on my MacBook Air M1 2020 (physical display resolution=2560x1600), running MacOs 12.0.1, using winit 0.26.0.

I.e. the current resolution is not among the available resolutions (and it's even larger than what my display supports).

Metadata

Metadata

Assignees

No one assigned

    Labels

    DS - appkitAffects the AppKit/macOS backend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions