Skip to content

Update WindowItem's visibility

Vlad Zahorodnii requested to merge work/zzag/window-item-update-visibility into master

With this, the WindowItem will know whether it's actually visible. As the result, if a native wayland window has been minimized, kwin won't try to schedule a new frame if just a frame callback has been committed.

EffectWindow::enablePainting() and EffectWindow::disablePainting() act as a stone in the shoe. They have the final say whether the given window is visible and they are invoked too late in the rendering process. WindowItem needs to know whether the window is visible in advance, before compositing starts.

This change replaces EffectWindow::enablePainting() and EffectWindow::disablePainting() with EffectWindow::refVisible() and EffectWindow::unrefVisible(). If an effect calls the refVisible() function, the window will be kept visible regardless of its state. It should be called when a window is minimized or closed, etc. If an effect doesn't want to paint a window, it should not call effects->paintWindow().

EffectWindow::refVisible() doesn't replace EffectWindow::refWindow() but supplements it. refVisible() only ensures that a window will be kept visible while refWindow() ensures that the window won't be destroyed until the effect is done with it.


  • Edit: With this, ScreenLockerFilter can be also killed.
Edited by Vlad Zahorodnii

Merge request reports

Loading