diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/tabs/setup_video.cpp | 4 | ||||
-rw-r--r-- | src/gui/windowmanager.cpp | 24 | ||||
-rw-r--r-- | src/gui/windowmanager.h | 4 |
3 files changed, 29 insertions, 3 deletions
diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index 77b56289e..e96320762 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -378,7 +378,7 @@ void Setup_Video::action(const ActionEvent &event) if (intToRenderType(config.getIntValue("opengl")) == RENDER_SOFTWARE) { - WindowManager::resizeVideo(width, height, false); + WindowManager::doResizeVideo(width, height, false); } else { @@ -419,7 +419,7 @@ void Setup_Video::action(const ActionEvent &event) } #else mainGraphics->setWindowSize(width, height); - WindowManager::resizeVideo(width, height, false); + WindowManager::doResizeVideo(width, height, false); #endif } diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp index 4be7c3600..dfc72ab73 100644 --- a/src/gui/windowmanager.cpp +++ b/src/gui/windowmanager.cpp @@ -55,6 +55,9 @@ #include "utils/files.h" #include "utils/sdlcheckutils.h" #include "utils/sdlhelper.h" +#ifdef __native_client__ +#include "utils/naclmessages.h" +#endif // __native_client__ #ifdef ANDROID #ifndef USE_SDL2 @@ -175,6 +178,25 @@ int WindowManager::getFramerate() return SDL_getFramerate(&fpsManager); } +void WindowManager::doResizeVideo(int actualWidth, + int actualHeight, + const bool always) +{ + if (!always + && mainGraphics->mActualWidth == actualWidth + && mainGraphics->mActualHeight == actualHeight) + { + return; + } + +#ifdef __native_client__ + naclPostMessage("resize-window", + strprintf("%d,%d", actualWidth, actualHeight)); +#else + resizeVideo(actualWidth, actualHeight, always); +#endif +} + void WindowManager::resizeVideo(int actualWidth, int actualHeight, const bool always) @@ -257,7 +279,7 @@ void WindowManager::applyScale() if (mainGraphics->getScale() == scale) return; mainGraphics->setScale(scale); - resizeVideo(mainGraphics->mActualWidth, + doResizeVideo(mainGraphics->mActualWidth, mainGraphics->mActualHeight, true); } diff --git a/src/gui/windowmanager.h b/src/gui/windowmanager.h index 8983ac82b..8acdce0fd 100644 --- a/src/gui/windowmanager.h +++ b/src/gui/windowmanager.h @@ -49,6 +49,10 @@ namespace WindowManager void applyKeyRepeat(); + void doResizeVideo(int actualWidth, + int actualHeight, + const bool always); + void resizeVideo(int actualWidth, int actualHeight, const bool always); |