This change enables the use of HW cursors on Nvidia GPUs. The problem
with the current approach is that the cursor plane requires a linear
buffer to be attached on the Nvidia hardware. However, Nvidia GPUs
cannot render to a linear texture, this is why DRM_FORMAT_MOD_LINEAR is
marked as "external only" when the supported modifiers are queried by
eglQueryDmaBufModifiersEXT(). Since the EGL render backend in KWin
cannot find a common DRM format modifier between what the cursor plane
needs and what the GPU can render to, it falls back to the SW cursor
implementation.
With this change, when the EGL renderer detects that a plane only
supports linear buffers but rendering directly to a linear buffer is not
possible, it copies the rendered content into a linear dumb buffer, and
attaches that buffer to the plane instead of using the rendered buffer
directly.
This overhauls the kill prompt UI to make it more modern and more
easily to grasp.
* Reduce the amount of text and redundancy.
Give the window a title and drop the "app is not responding" heading.
Try to remove the application name from the displayed window title.
Also use the bold emphasis used in other places like deleting files.
* Use the application icon if available with a warning overlay.
This makes it easier to grasp which application it's talking about.
* Move technical information (like PID and hostname) into an
expandable "Details" section.
KGuiAddons has been implicitly pulled in by KConfigWidgets already.
Instead of killing the window without asking, show the kill prompt
like it's done for X11 windows.
The window in question is exported through XDG foreign so the kill
helper can parent itself to it, and an activation token is also provided.
Also, the more contemporary desktop file name is now used for
identification rather than window class.
A no-display desktop file is installed for the kill helper so that it
can get a proper window icon and suppress startup notification.
Without a client asking for it. This way we can send a surface
to another helper application, such as the window killer.
An ExportedSurface wrapper class is introduced which represents
an exported surface in a windowing-system independent way.
This makes it consistent with the timeout used on X11.
The current ping timeout was also generally quite short, causing apps
to desaturate for brief moments when they were busy e.g. starting up
or loading large files.
Closed windows are present in the stack. If user has selected
"Stacking order" sort order in task switcher KCM, we need to guard
against closed windows in the stack.
Otherwise dangling pointers can end up in TabBox::ClientModel. Tabbox is
written with hard model resets in mind. In order to fix it, the client
model has to be rewritten.
BUG: 477166
Ideally the decoration of a closed window should not change. However,
it seems like it can happen when resuming the session.
When switching to another VT, the touchpad input device is removed, but
the touch input device is still kept on my machine. This results in
the tablet mode changing temporarily and triggering recalculation of new
borders in breeze decoration. It's a no-no thing to do if the window is
closed. We need to guard against this case. But in long term, we need to
reroute all decoration state updates through kwin so it can block state
updates when the window is closed. It's also needed for double buffered
state.
How to improve handling of tablet mode detection when switching between
VTs needs a separate investigation.
CCBUG: 477166
sRGB content is made to be encoded with the sRGB piece-wise transfer function,
and to be decoded by displays with the gamma 2.2 transfer function.
When KWin has a display in sRGB mode, this doesn't make a difference - it
decodes with sRGB and encodes with sRGB, so there's effectively no transformation.
When the display is in PQ mode though, KWin uses the sRGB inverse EOTF for
decoding sRGB content, but not the sRGB EOTF for encoding it again.
To fix this, this commit changes KWin to use the gamma 2.2 EOTF and inverse
EOTF for untagged content. That's not technically correct for sRGB screenshots,
where we'd have to use the piecewise sRGB EOTF, but that's a problem that
can be solved in the future.
Bouce keys suppresses additional key presses during a given interval
This is used by people with motor impairments or bad keyboards
It works by remembering the last input timestamp for a key
If an event's timestamp is too close to the last timestamp for that key the event is rejected
BUG: 474752
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