From a442f121e62d8ae6ce19b3d3bbde27f5babdeb82 Mon Sep 17 00:00:00 2001 From: "J?rgen P. Tjern?" Date: Wed, 15 Jan 2014 11:08:55 -0800 Subject: [PATCH] Test: Add Shift-Enter to switch between FS and desktop FS. --- src/test/SDL_test_common.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 690a07629..38b093a43 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1433,7 +1433,19 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); } } + } else if (withShift) { + /* Shift-Enter toggle fullscreen desktop / fullscreen */ + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + if (window) { + Uint32 flags = SDL_GetWindowFlags(window); + if ((flags & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP) { + SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN); + } else { + SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); + } + } } + break; case SDLK_b: if (withControl) {