Skip to content

Commit 789383f

Browse files
committed
Fix issue with setWindowMode transitions not working properly
1 parent 1bd1c02 commit 789383f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Add `SDL.Exception` module, exposing `SDLException`
55
* Add joystick POV hat support
66
* Remove deprecated `InitEverything` enumeration
7+
* Fix issue with `setWindowMode` transitions not working properly between
8+
fullscreen and windowed modes.
79

810
2.1.3.1
911
=======

src/SDL/Video.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,11 @@ setWindowMode :: MonadIO m => Window -> WindowMode -> m ()
265265
setWindowMode (Window w) mode =
266266
liftIO . throwIfNot0_ "SDL.Video.setWindowMode" "SDL_SetWindowFullscreen" $
267267
case mode of
268-
Fullscreen -> Raw.setWindowFullscreen w Raw.SDL_WINDOW_FULLSCREEN
269-
FullscreenDesktop -> Raw.setWindowFullscreen w Raw.SDL_WINDOW_FULLSCREEN_DESKTOP
268+
Fullscreen -> Raw.setWindowFullscreen w Raw.SDL_WINDOW_FULLSCREEN <* Raw.raiseWindow w
269+
FullscreenDesktop -> Raw.setWindowFullscreen w Raw.SDL_WINDOW_FULLSCREEN_DESKTOP <* Raw.raiseWindow w
270270
Maximized -> Raw.setWindowFullscreen w 0 <* Raw.maximizeWindow w
271271
Minimized -> Raw.minimizeWindow w >> return 0
272-
Windowed -> Raw.restoreWindow w >> return 0
272+
Windowed -> Raw.setWindowFullscreen w 0 <* Raw.restoreWindow w
273273

274274
-- | Set the position of the window.
275275
setWindowPosition :: MonadIO m => Window -> WindowPosition -> m ()

0 commit comments

Comments
 (0)