QTfrontend/gameuiconfig.cpp
changeset 11383 d3b603323b2b
parent 11362 ed5a6478e710
child 12237 76fa467b6833
--- a/QTfrontend/gameuiconfig.cpp	Sat Nov 14 22:19:05 2015 +0300
+++ b/QTfrontend/gameuiconfig.cpp	Sun Nov 15 13:35:23 2015 +0100
@@ -86,10 +86,11 @@
     else Form->ui.pageOptions->CBResolution->setCurrentIndex(t);
 
     // Default the windowed resolution to 5/6 of the screen size
-    int screenWidth = SDL_GetVideoInfo()->current_w * 5 / 6;
-    int screenHeight = SDL_GetVideoInfo()->current_h * 5 / 6;
-    QString widthStr; widthStr.setNum(screenWidth);
-    QString heightStr; heightStr.setNum(screenHeight);
+    QSize screenSize = SDLInteraction::instance().getCurrentResolution();
+    screenSize *= 5.0 / 6;
+
+    QString widthStr = QString::number(screenSize.width());
+    QString heightStr = QString::number(screenSize.height());
     QString wWidth = value("video/windowedWidth", widthStr).toString();
     QString wHeight = value("video/windowedHeight", heightStr).toString();
     // If left blank reset the resolution to the default