Place transients of window being raised in correct order when moving
them within unconstrained_stacking_order list; this way we don't have to
reorder them each time we call constrainedStackingOrder() later on.
Workspace::lowerWindow() already does it correctly.
With LayerShell all docks were in the above layer to match with the
semantics of the specification. Under X11 our main panel was also in the
above layer by setting the keep above flag.
The only thing that ended up in the dock layer were wayland applet
popups, and that was mostly by accident. When they get a transient
parent fixed they'll end up in the AboveLayer anyway so we should drop
it now to reduce complications.
This fixes a bug where applet popups could go under the panel.
BUG: 465354
If a constraint indicates that window A must be below window B but it's
not the case at the moment, the workspace will move window A right after
window B.
This can invert the relative order of transient siblings, for example
let's say that there are three constraints
- A <- B (window A must be below window B)
- A <- C
- A <- D
and the unconstrained stacking order looks as follows: [B, C, D, A]. The
final constrained stacking order is expected to look as [A, B, C, D],
but currently it's [A, D, C, B] instead:
- starting stacking order: [B, C, D, A]
- apply A <- B constraint: [C, D, A, B]
- apply A <- C constraint: [D, A, C, B]
- apply A <- D constraint: [A, D, C, B]
In order to fix this issue, this patch makes the workspace traverse the
constraint graph in the reverse order. In addition to that, it ensures
that the relative order of transient siblings in unconstrained stacking
order is preserved in the constrained one.
BUG: 477262
It's no longer relevant after merging libkwin and libkwineffects. By
dropping EffectsHandler::renderScreen() and making the screen transform
use the Scene API directly, we can clean up some OpenGL context handling
code.
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
Maximized windows get resized to this when the last output gets removed, which
can increase VRAM load unnecessarily. As the placement tracker resizes windows
back to their original size, we can reduce the size of the placeholder output
without causing additional issues
Opening the user actions menu causes auto-hiding layer-shell windows
(such as Kickoff, KRunner) to hide, closing the menu and having KWin
transfer focus back to the window which is now half-destroyed.
XdgToplevelWindow::acceptsFocus() also checks for isDeleted().
The brightness overrides are for displays with missing or broken brightness
data in their EDID, and allow the user to work around those displays. In
the future we could also offer an HDR calibration process that allows determining
the correct brightness values for the screen.
The gamut wideness setting allows the user to tweak what gamut KWin assumes
sRGB applications to have. This is useful for working around the gamut mapping
displays do, which make sRGB content look washed out, and also to allow
users to make colors of sRGB apps look more saturated if they wish to.
glReadPixels reads from the bound framebuffer, so create an offscreen
framebuffer and attach the texture to it
Co-authored-by: Jan Grulich <jgrulich@redhat.com>
This allows Plasma to gracefully close windows on shutdown by sending
xdg_toplevel.close. If after 10 seconds windows are still open because
they prompt for unsaved changes or similar cases, a notification is
shown to either prompt or logout regardless.
CCBUG: 461176
Never auto-activate Wayland windows when "Extreme" focus stealing
prevention is configured. This allows to more easily find places
where window activation isn't properly implemented, such as on
application startup.
The closefb ioctl removes the userspace reference from the framebuffer but does
not try to disable planes and outputs if the buffer is still used. This allows
for example for smoother transitions between SDDM and the Plasma session
This is not compatible with plugins that install their own filters. The
approach in this patch is not elegant, but it should work. Another option
would be to convert these filters and spies to QObjects and use QObject
ownership model, but this would be also too excessive just to save a few
lines of code.
We don't need an intermediate widget class here, we can set up the UI directly, like it's done in several effect KCMs already
Not only does this simplify the code, it also fixes crashes due to broken ownership
BUG: 477020