kwin/src/effect
Vlad Zahorodnii 6a997b41ae Fix screen becoming black when its geometry changes while overview is active
Offscreen quick views are repainted in the pre paint step because that
requires a QOpenGLContext and we don't want it to mess with kwin's
opengl context. After a view is updated, its QOpenGLContext is going to
be unbound.

During normal operation mode, it works as expected:

- the view gets updated in the pre paint stage
- kwin opengl context is made current when starting the paint stage
- the offscreen view is painted on the screen

However, effects->renderScreen() has no such separation. The OpenGL
context changes from the pre paint stage will leak to the paint stage.
So we have

- the workspace notifies that the screens have changed
- the screen transform effect sees that, makes opengl context current
  and renders the screen
- the offscreen quick view is updated and after OffscreenQuickView
  is done, it's going to call QOpenGLContext::doneCurrent()
- effects->renderScreen() calls m_scene->paint()
- since there's no current opengl context, vbo allocation in
  GLTexture::render() will fail and nothing will be rendered on the
  screen

As a way around it, this change adds a makeOpenGLContextCurrent() call
before the paint stage. It doesn't quite belong there, the opengl
context has to be made current in the paint stage, e.g. by the
ItemRenderer or something. But atm we have no good place where we
could stick it in.

BUG: 477027
2023-11-21 19:11:44 +00:00
..
anidata.cpp effects.h -> effecthandler.h 2023-11-20 15:47:36 +00:00
anidata_p.h Extract EffectWindow into its own header 2023-11-20 15:47:36 +00:00
animationeffect.cpp effects.h -> effecthandler.h 2023-11-20 15:47:36 +00:00
animationeffect.h
effect.cpp effects.h -> effecthandler.h 2023-11-20 15:47:36 +00:00
effect.h
effectframe.cpp effects.h -> effecthandler.h 2023-11-20 15:47:36 +00:00
effectframe.h
effecthandler.cpp Fix screen becoming black when its geometry changes while overview is active 2023-11-21 19:11:44 +00:00
effecthandler.h effects.h -> effecthandler.h 2023-11-20 15:47:36 +00:00
effectloader.cpp config.h: Use constexpr QLatin1String instead of char* 2023-11-21 08:09:38 +00:00
effectloader.h
effecttogglablestate.cpp effects.h -> effecthandler.h 2023-11-20 15:47:36 +00:00
effecttogglablestate.h
effectwindow.cpp Merge EffectWindow::{windowMinimized,windowUnminimized} 2023-11-21 18:20:02 +00:00
effectwindow.h Merge EffectWindow::{windowMinimized,windowUnminimized} 2023-11-21 18:20:02 +00:00
globals.h
logging.cpp
logging_p.h
offscreeneffect.cpp effects.h -> effecthandler.h 2023-11-20 15:47:36 +00:00
offscreeneffect.h
offscreenquickview.cpp effects.h -> effecthandler.h 2023-11-20 15:47:36 +00:00
offscreenquickview.h
quickeffect.cpp effects.h -> effecthandler.h 2023-11-20 15:47:36 +00:00
quickeffect.h
timeline.cpp
timeline.h
xcb.h