Skip to content

macOS fullscreen toggle is broken #2520

@rofferom

Description

@rofferom

Problem description

Mutiple toggle of fullscreen on macOS won't work:

.set_fullscreen(Some(window::Fullscreen::Borderless(monitor)))
.set_fullscreen(None)
.set_fullscreen(Some(window::Fullscreen::Borderless(monitor)))

The first and the second calls are working, but the last one does nothing.

Analysis try

After a quick git bisect, it seems that #2458 (d67c928) has broken the feature.

I put some logs to try to track what is happening, it seems to be because WinitWindowDelegate isn't called on windowWillEnterFullscreen, whereas windowWillExitFullScreen is called.

So this state is updated in windowWillExitFullScreen handler full code here :

shared_state.in_fullscreen_transition = true;

Then, macos::UnownedWindow::set_fullscreen() will return here (full code here)

        if shared_state_lock.in_fullscreen_transition {
            // We can't set fullscreen here.
            // Set fullscreen after transition.
            shared_state_lock.target_fullscreen = Some(fullscreen);
            return;
        }

Infos

  • OS version: 12.6 (x64)
  • SHA-1 used: 462bb4d

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions