summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-09-10 16:07:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-09-11 09:50:22 +0200
commit1a547a566eba5943f9e4d9987baf4aee80846dd1 (patch)
tree585cd63ae31d7ec789844208f203a7e68d85954b /vcl/source/opengl
parent3428bd5fa3626844355f20997ba690fd04297982 (diff)
hidpi+gtk3: move setting the opengl slide viewport
to when the window size is set, and adjust to gtk3 hidpi scaling factor Change-Id: Id9bd0defd0b6ae640ac57f88133d954202d4bcc3 Reviewed-on: https://gerrit.libreoffice.org/42143 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx11
1 files changed, 9 insertions, 2 deletions
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)