From eba34251cee51134bba7644a84da49583da599f7 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 12 Jan 2014 13:43:20 +0200 Subject: [PATCH] Change video mode before reconfiguring the window This prevents the window options from getting out of sync if the video mode can't be set. --- source/graphics/window.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/graphics/window.cpp b/source/graphics/window.cpp index 256ab2d..00acbc4 100644 --- a/source/graphics/window.cpp +++ b/source/graphics/window.cpp @@ -62,16 +62,16 @@ void Window::reconfigure(const WindowOptions &opts) bool fullscreen_changed = (opts.fullscreen!=options.fullscreen); resizing = (opts.width!=options.width || opts.height!=options.height); - options = opts; - platform_reconfigure(fullscreen_changed); - if(visible) { - if(options.fullscreen) - display.set_mode(VideoMode(options.width, options.height)); + if(opts.fullscreen) + display.set_mode(VideoMode(opts.width, opts.height)); else if(fullscreen_changed) display.restore_mode(); } + + options = opts; + platform_reconfigure(fullscreen_changed); } void Window::set_keyboard_autorepeat(bool r) -- 2.45.2