From 4ade508a347bc5a9fa177c90c8ac7a5b7e4680fc Mon Sep 17 00:00:00 2001 From: Wedge009 Date: Sat, 22 Aug 2015 22:31:33 +1000 Subject: [PATCH] Avoid inaccessible window title bar. Use SDL_WINDOWPOS_UNDEFINED instead of (0, 0) as initial window position. --- src/video.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video.cpp b/src/video.cpp index bcc747df2da..3c1b61a8deb 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -543,7 +543,9 @@ int CVideo::setMode( int x, int y, int bits_per_pixel, int flags ) fullScreen = (flags & FULL_SCREEN) != 0; if(!window) { - window = new sdl::twindow("", 0, 0, x, y, flags, SDL_RENDERER_SOFTWARE); + // SDL_WINDOWPOS_UNDEFINED allows SDL to centre the window in the display instead of using a fixed initial position. + // Note that x and y in this particular case refer to width and height of the window, not co-ordinates. + window = new sdl::twindow("", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, x, y, flags, SDL_RENDERER_SOFTWARE); } else { if(fullScreen) { window->full_screen();