Skip to content

Commit

Permalink
Move Mouse window bounds assignment to ApplyWindowChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Aug 6, 2020
1 parent c665d2e commit d926c53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/FNAPlatform/SDL2_FNAPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,14 @@ out mode
(uint) SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP
);
}

// Update the mouse window bounds
if (Mouse.WindowHandle == window)
{
Rectangle b = GetWindowBounds(window);
Mouse.INTERNAL_WindowWidth = b.Width;
Mouse.INTERNAL_WindowHeight = b.Height;
}
}

public static Rectangle GetWindowBounds(IntPtr window)
Expand Down
4 changes: 0 additions & 4 deletions src/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -829,10 +829,6 @@ private void BeforeLoop()
currentAdapter = FNAPlatform.RegisterGame(this);
IsActive = true;

Rectangle windowBounds = Window.ClientBounds;
Mouse.INTERNAL_WindowWidth = windowBounds.Width;
Mouse.INTERNAL_WindowHeight = windowBounds.Height;

// Perform initial check for a touch device
TouchPanel.TouchDeviceExists = FNAPlatform.GetTouchCapabilities().IsConnected;
}
Expand Down

0 comments on commit d926c53

Please sign in to comment.