diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-28 14:15:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-28 14:22:13 +0100 |
commit | b012e83e1cd09a0b6f9ede94a5c2d72d24459ce4 (patch) | |
tree | de9571533f2ecc03e954179178296eeac96b102e /vcl/source/opengl | |
parent | 946a049114a27d342c1974be524576e348ce4ad2 (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
Diffstat (limited to 'vcl/source/opengl')
-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 f04d80f38e65..d0bce2e7d240 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -965,12 +965,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; @@ -979,6 +995,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; |