stride3d / stride3d/stride

MouseSDL does not update 'SurfaceSize' if window size changed

Open
#770 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Input bug priority-high work-estimate-S
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: Official Release

Version: Xenko 3.1.0.1

Platform(s): Windows

Describe the bug
MouseSDL does not update value of property 'SurfaceSize' if game window size changed.

To Reproduce
Steps to reproduce the behavior:

  1. Create any example game project.
  2. Run game using SDL context: game.Run(GameContextFactory.NewGameContextSDL());
  3. Change the game window size:
Game.GraphicsDeviceManager.PreferredBackBufferWidth = width;
Game.GraphicsDeviceManager.PreferredBackBufferHeight = height;
Game.GraphicsDeviceManager.ApplyChanges();
  1. Compare values of Game.Window.ClientBounds and Game.Input.Mouse.SurfaceSize. It has different values.

Additional context
Event Game.Window.ClientSizeChanged may be reason of this behavior. It event does not firing if SDL context using.

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 with MouseSDL and the SDL context created by GameContextFactory.NewGameContextSDL(), then reproduce the resize steps using GraphicsDeviceManager.ApplyChanges(). Compare Game.Window.ClientBounds with Game.Input.Mouse.SurfaceSize after resizing; done means both values stay synchronized, including when ClientSizeChanged does not fire.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.