Skip to content

SDL_SetWindowFullscreen causes system freeze #16253

Description

@NorbertGerberg

Summary

When entering or exiting fullscreen on Windows, my application detects the change in window/display state and subsequently recreates the Vulkan swapchain. During this transition, the system may completely freeze.

After testing multiple configurations, the issue appears to occur specifically when using SDL3's borderless fullscreen mode through SDL_SetWindowFullscreen().

Reproduction

  1. Clone the following repository:
    https://github.com/Real-Ratty-Games/Tudo

  2. In Engine.cpp, change:

    mGDevice = new GraphicsDevice(*mWindow, EDrawAPI::DIRECT3D11, false);

    to use Vulkan:

    mGDevice = new GraphicsDevice(*mWindow, EDrawAPI::VULKAN, false);
  3. Run the application.

  4. Press F1 to enter fullscreen.

  5. Press F1 again to exit fullscreen.

Expected behavior

The application switches from borderless fullscreen back to windowed mode and continues running normally.

Actual behavior

The entire system freezes when exiting fullscreen.

I have been able to reproduce the issue on multiple physical PCs and laptops. I have not been able to reproduce it in virtual machines using GPU virtualization.

The application uses bgfx for rendering, but I have not been able to trace the issue back to bgfx itself.
Previous versions of SDL3 did not have this issue.

Workaround

The issue can be avoided by explicitly forcing one of the available display modes returned by SDL_GetFullscreenDisplayModes() instead of relying on SDL3's borderless fullscreen behavior.

I am not sure whether the issue is caused by SDL's handling of the fullscreen transition, the resulting display mode change, or the interaction between SDL3 and Vulkan during swapchain recreation.

My current guess is that the Vulkan swapchain recreation triggers a deadlock somewhere in the GPU driver or graphics stack, ultimately causing the system to freeze.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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