diff --git a/data/gui/screens/options_video.stkgui b/data/gui/screens/options_video.stkgui
index bcb418bff..a9a60688c 100644
--- a/data/gui/screens/options_video.stkgui
+++ b/data/gui/screens/options_video.stkgui
@@ -35,10 +35,10 @@
@@ -47,10 +47,10 @@
@@ -90,13 +90,8 @@
-
-
-
@@ -115,6 +110,12 @@
+
+
+
+
diff --git a/src/states_screens/options/options_screen_video.cpp b/src/states_screens/options/options_screen_video.cpp
index d201a1da3..bd8eea6d7 100644
--- a/src/states_screens/options/options_screen_video.cpp
+++ b/src/states_screens/options/options_screen_video.cpp
@@ -54,6 +54,7 @@
#include
using namespace GUIEngine;
+bool OptionsScreenVideo::m_fullscreen_checkbox_focus = false;
// --------------------------------------------------------------------------------------------
void OptionsScreenVideo::initPresets()
@@ -498,7 +499,12 @@ void OptionsScreenVideo::init()
#endif
updateResolutionsList();
-
+
+ if (m_fullscreen_checkbox_focus)
+ {
+ m_fullscreen_checkbox_focus = false;
+ getWidget("fullscreen")->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
+ }
} // init
// --------------------------------------------------------------------------------------------
@@ -907,8 +913,11 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name,
->handleNewSize(new_width, new_height);
irr_driver->handleWindowResize();
Screen* new_screen = screen_function();
+ OptionsScreenVideo::m_fullscreen_checkbox_focus = true;
new_screen->push();
}
+ else
+ OptionsScreenVideo::m_fullscreen_checkbox_focus = true;
}
else
updateResolutionsList();
@@ -920,6 +929,10 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name,
void OptionsScreenVideo::tearDown()
{
+ if (getWidget("fullscreen")->isVisible() &&
+ getWidget("fullscreen")->isFocusedForPlayer(PLAYER_ID_GAME_MASTER))
+ OptionsScreenVideo::m_fullscreen_checkbox_focus = true;
+
GUIEngine::getDevice()->setResizable(false);
#ifndef SERVER_ONLY
if (m_prev_adv_pipline != UserConfigParams::m_dynamic_lights &&
@@ -939,6 +952,14 @@ void OptionsScreenVideo::tearDown()
// --------------------------------------------------------------------------------------------
+bool OptionsScreenVideo::onEscapePressed()
+{
+ GUIEngine::focusNothingForPlayer(PLAYER_ID_GAME_MASTER);
+ return true;
+}
+
+// --------------------------------------------------------------------------------------------
+
void OptionsScreenVideo::unloaded()
{
m_inited = false;
diff --git a/src/states_screens/options/options_screen_video.hpp b/src/states_screens/options/options_screen_video.hpp
index 38508cc2e..f3d42330a 100644
--- a/src/states_screens/options/options_screen_video.hpp
+++ b/src/states_screens/options/options_screen_video.hpp
@@ -89,6 +89,7 @@ struct Resolution
class OptionsScreenVideo : public GUIEngine::Screen, public GUIEngine::ScreenSingleton
{
private:
+ static bool m_fullscreen_checkbox_focus;
bool m_prev_adv_pipline;
int m_prev_img_quality;
OptionsScreenVideo();
@@ -122,6 +123,8 @@ public:
/** \brief implement optional callback from parent class GUIEngine::Screen */
virtual void unloaded() OVERRIDE;
+ virtual bool onEscapePressed() OVERRIDE;
+
void updateGfxSlider();
void updateBlurSlider();
void updateScaleRTTsSlider();