stride3d / stride3d/stride

Exception when switching window from fullscreen to windowed mode

Open
#1,493 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: Official Release

Version: 4.1.0.1734

Platform: Windows

Describe the bug
Exception during switching to windowed mode.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new game project using default settings
  2. Add a SyncScript asset with the following code:
using Stride.Engine;
using Stride.Input;

public class FullScreenToggler : SyncScript
{
    public override void Update()
    {
        if (Input.Keyboard.IsKeyDown(Keys.F))
        {
            Game.Window.IsFullscreen = !Game.Window.IsFullscreen;
        }
    }
}
  1. Add a ScriptComponent with the script from step 2 to the Camera (or any other) entity.
  2. Run the game using F5 hotkey (or in any other way).
  3. Toggle fullscreen mode using the "F" or "Alt+Enter" hotkey.
  4. Toggle windowed mode using exactly "F" hotkey (handled by the script from step 2).

Expected behavior
Game window is switched to windowed mode like it was before step 5 execution.

Screenshots
ContentSerializationExceptions

Log and callstacks

Additional context

  1. Using the "Alt+Enter" hotkey in step 6 (for switching back from fullscreen mode to windowed) works as expected.
  2. Even an empty scene with the only empty entity on it which has the ScriptComponent with the script from step 2 works as described.
  3. There are also similar issues, but they all belongs to a different kind of exception.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the FullScreenToggler SyncScript and the Game.Window.IsFullscreen transition described in the steps. Review the linked exception information and console logs to identify the fullscreen-to-windowed path involved. Done means switching back with the script's F hotkey returns to windowed mode without an exception, while Alt+Enter continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, game-dev, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.