aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJohannes Schickel2008-09-22 17:33:30 +0000
committerJohannes Schickel2008-09-22 17:33:30 +0000
commitf8574c52f8ae48799241a8fb4e88d000b86efd65 (patch)
tree64275f2a8078c4c99b587828434721308068fa7e /backends
parentaf3cbfc32e56e0cc72b532d6fa63da90651c9c58 (diff)
downloadscummvm-rg350-f8574c52f8ae48799241a8fb4e88d000b86efd65.tar.gz
scummvm-rg350-f8574c52f8ae48799241a8fb4e88d000b86efd65.tar.bz2
scummvm-rg350-f8574c52f8ae48799241a8fb4e88d000b86efd65.zip
Fixed full screen toggling via alt+enter.
svn-id: r34627
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/sdl/events.cpp2
-rw-r--r--backends/platform/sdl/graphics.cpp19
2 files changed, 11 insertions, 10 deletions
diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp
index a4a72ca380..a7a9251678 100644
--- a/backends/platform/sdl/events.cpp
+++ b/backends/platform/sdl/events.cpp
@@ -195,7 +195,9 @@ bool OSystem_SDL::pollEvent(Common::Event &event) {
// Alt-Return and Alt-Enter toggle full screen mode
if (b == Common::KBD_ALT && (ev.key.keysym.sym == SDLK_RETURN
|| ev.key.keysym.sym == SDLK_KP_ENTER)) {
+ beginGFXTransaction();
setFullscreenMode(!_fullscreen);
+ endGFXTransaction();
#ifdef USE_OSD
if (_fullscreen)
displayMessageOnOSD("Fullscreen mode");
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 030ba07ec6..96b74ecba7 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -691,20 +691,14 @@ bool OSystem_SDL::saveScreenshot(const char *filename) {
void OSystem_SDL::setFullscreenMode(bool enable) {
Common::StackLock lock(_graphicsMutex);
+
+ if (_fullscreen == enable)
+ return;
- if (_fullscreen != enable && _transactionMode == kTransactionCommit) {
+ if (_transactionMode == kTransactionCommit) {
assert(_hwscreen != 0);
_fullscreen = enable;
- if (_transactionMode == kTransactionActive) {
- _transactionDetails.fs = enable;
- _transactionDetails.fsChanged = true;
-
- _transactionDetails.needHotswap = true;
-
- return;
- }
-
// Switch between fullscreen and windowed mode by invoking hotswapGFXMode().
// We used to use SDL_WM_ToggleFullScreen() in the past, but this caused various
// problems. E.g. on OS X, it was implemented incorrectly for a long time; on
@@ -713,6 +707,11 @@ void OSystem_SDL::setFullscreenMode(bool enable) {
// So, we just do it "manually" now. There shouldn't be any drawbacks to that
// anyway.
hotswapGFXMode();
+ } else if (_transactionMode == kTransactionActive) {
+ _transactionDetails.fs = enable;
+ _transactionDetails.fsChanged = true;
+
+ _transactionDetails.needHotswap = true;
}
}