diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-28 14:15:37 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-03-30 12:46:18 +0200 |
commit | 9eea668c0e5a25a0d495ea749afb5b48346cdd94 (patch) | |
tree | 62bd8cc131b48959483c99f1ce4db46eb4fbf24f /vcl/source | |
parent | 7618142f81459230b6f97731867875fcd14af8f2 (diff) |
Resolves: tdf#106155 avoid opengl for toplevel X window icons
because an opengl context requires a toplevel window so it recurses to death.
Only the gen/kde4 vclplugs are affected here
Change-Id: If5396d183d90d1872931b170dc90c3a70d8ea6b6
(cherry picked from commit b012e83e1cd09a0b6f9ede94a5c2d72d24459ce4)
Reviewed-on: https://gerrit.libreoffice.org/35803
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit b96c52baa6b9607d9a31cd1b34162e4ee041f9b6)
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/opengl/OpenGLHelper.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index f07e7dcbfa8e..e00a93aa4586 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -976,12 +976,28 @@ OpenGLVCLContextZone::OpenGLVCLContextZone() OpenGLContext::makeVCLCurrent(); } +namespace +{ + bool bTempOpenGLDisabled = false; +} + +PreDefaultWinNoOpenGLZone::PreDefaultWinNoOpenGLZone() +{ + bTempOpenGLDisabled = true; +} + +PreDefaultWinNoOpenGLZone::~PreDefaultWinNoOpenGLZone() +{ + bTempOpenGLDisabled = false; +} + bool OpenGLHelper::isVCLOpenGLEnabled() { /** * The !bSet part should only be called once! Changing the results in the same * run will mix OpenGL and normal rendering. */ + static bool bSet = false; static bool bEnable = false; static bool bForceOpenGL = false; @@ -990,6 +1006,11 @@ bool OpenGLHelper::isVCLOpenGLEnabled() if ( Application::IsConsoleOnly() ) return false; + //tdf#106155, disable GL while loading certain bitmaps needed for the initial toplevel windows + //under raw X (kde4) vclplug + if (bTempOpenGLDisabled) + return false; + if (bSet) { return bForceOpenGL || bEnable; |