diff options
-rw-r--r-- | include/vcl/opengl/OpenGLContext.hxx | 1 | ||||
-rw-r--r-- | slideshow/source/engine/opengl/TransitionerImpl.cxx | 1 | ||||
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 11 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 13 |
4 files changed, 23 insertions, 3 deletions
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx index 738f503269d2..b638d70ccc36 100644 --- a/include/vcl/opengl/OpenGLContext.hxx +++ b/include/vcl/opengl/OpenGLContext.hxx @@ -158,6 +158,7 @@ public: private: virtual bool initWindow(); virtual void destroyCurrentContext(); + virtual void adjustToNewSize(); protected: bool InitGL(); diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx b/slideshow/source/engine/opengl/TransitionerImpl.cxx index 95d97533325e..846b5ca8c0c0 100644 --- a/slideshow/source/engine/opengl/TransitionerImpl.cxx +++ b/slideshow/source/engine/opengl/TransitionerImpl.cxx @@ -344,7 +344,6 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta mpContext->swapBuffers(); - glViewport(0, 0, aCanvasArea.Width, aCanvasArea.Height); CHECK_GL_ERROR(); return true; diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index d2a5fc8a963b..d5ade0408fc5 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -333,14 +333,21 @@ void OpenGLContext::restoreDefaultFramebuffer() void OpenGLContext::setWinPosAndSize(const Point &rPos, const Size& rSize) { - if(m_xWindow) + if (m_xWindow) m_xWindow->SetPosSizePixel(rPos, rSize); - if( m_pChildWindow ) + if (m_pChildWindow) m_pChildWindow->SetPosSizePixel(rPos, rSize); GLWindow& rGLWin = getModifiableOpenGLWindow(); rGLWin.Width = rSize.Width(); rGLWin.Height = rSize.Height(); + adjustToNewSize(); +} + +void OpenGLContext::adjustToNewSize() +{ + const GLWindow& rGLWin = getOpenGLWindow(); + glViewport(0, 0, rGLWin.Width, rGLWin.Height); } void OpenGLContext::setWinSize(const Size& rSize) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 2e76077521fc..72b71c9d7519 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -978,6 +978,19 @@ private: } #endif + virtual void adjustToNewSize() override + { +#if GTK_CHECK_VERSION(3,16,0) + if (m_pGLArea) + { + int scale = gtk_widget_get_scale_factor(m_pGLArea); + int width = m_aGLWin.Width * scale; + int height = m_aGLWin.Height * scale; + glViewport(0, 0, width, height); + } +#endif + } + virtual void makeCurrent() override { if (isCurrent()) |