From 1a524dc9468fe532bc060a73ef736a68687aadca Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 11 Sep 2012 17:17:38 +0300 Subject: Fix windows software mode on the fly resize. --- src/gui/setup_video.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 5250028d2..3bd6ab139 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -480,21 +480,29 @@ void Setup_Video::action(const gcn::ActionEvent &event) if (!width || !height) return; - // TODO: Find out why the drawing area doesn't resize without a restart. if (width != mainGraphics->mWidth || height != mainGraphics->mHeight) { #if defined(_WIN32) - if (width < mainGraphics->mWidth || height < mainGraphics->mHeight) + if (!config.getIntValue("opengl")) { - new OkDialog(_("Screen Resolution Changed"), - _("Restart your client for the change to take effect.") - + std::string("\n") + _("Some windows may be moved to " - "fit the lowered resolution.")); + Client::resize(width, height); } else { - new OkDialog(_("Screen Resolution Changed"), - _("Restart your client for the change to take effect.")); + if (width < mainGraphics->mWidth + || height < mainGraphics->mHeight) + { + new OkDialog(_("Screen Resolution Changed"), + _("Restart your client for the change to take effect.") + + std::string("\n") + _("Some windows may be moved to " + "fit the lowered resolution.")); + } + else + { + new OkDialog(_("Screen Resolution Changed"), + _("Restart your client for the change" + " to take effect.")); + } } #else Client::resize(width, height); -- cgit v1.2.3-60-g2f50