Skip to content

Fullscreen borderless window does not exit on MacOS #2283

@odanek

Description

@odanek

When window is created in the Fullscreen::Borderless mode setting control_flow to ControloFlow::Exit does not exit the event loop:

use winit::{
    event_loop::{ControlFlow, EventLoop},
    window::{Fullscreen, WindowBuilder},
};

fn main() {
    let event_loop = EventLoop::new();
    
    let window = WindowBuilder::new()
        .with_fullscreen(Some(Fullscreen::Borderless(None)))
        .build(&event_loop)
        .unwrap();

    event_loop.run(move |_, _, control_flow| {
        *control_flow = ControlFlow::Exit;
    });
}

Commenting out the .with_fullscreen(...) line does correctly exit the event loop.

Reproduced on:
winit 0.26.1
rustc 1.60.0
MacOS 12.3.1
MacBook Pro M1

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedC - needs investigationIssue must be confirmed and researchedDS - 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