Commit graph

25830 commits

Author SHA1 Message Date
David Redondo
ff76c8581d Do not wait for timer if there are no open windows
If there were no open windows KWin would wait until the timer ran
out and return false signifying that some windows didnt close.
BUG:477573
FIXED-IN:6.0
2023-11-28 09:08:47 +01:00
l10n daemon script
a705c172ab GIT_SILENT Sync po/docbooks with svn 2023-11-28 02:13:11 +00:00
Oliver Beard
9b73cdeeba Find WaylandClient in non-testing builds 2023-11-27 17:30:41 +00:00
Aleix Pol Gonzalez
b853de3d29 Allow building KWin without KGlobalAccel
Signed-off-by: Falko Becker <falko.becker@mbition.io>
2023-11-27 17:07:28 +01:00
Aleix Pol Gonzalez
25a976e559 Fix build Reduced kwin
GuiPrivate is also needed for the OffScreenQuickView

Signed-off-by: Falko Becker <falko.becker@mbition.io>
2023-11-27 17:07:28 +01:00
Doğukan Korkmaztürk
d4103fa9c1 backends/drm: Support hardware cursors on NVidia GPUs
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.
2023-11-27 10:47:12 -05:00
Kai Uwe Broulik
7bd9ae8d0b helpers/killer: Modernize UI
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.
2023-11-27 14:10:15 +00:00
Kai Uwe Broulik
5c96c38e39 Support kill prompt for XdgTopLevelWindows
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.
2023-11-27 14:10:15 +00:00
Kai Uwe Broulik
9b7718459e xdgforeign: Allow exporting surfaces internally
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.
2023-11-27 14:10:15 +00:00
Kai Uwe Broulik
2b868edb9e xdgshell: Use killPingTimeout option
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.
2023-11-27 14:10:15 +00:00
Kai Uwe Broulik
28c1545beb wayland_server: Initialize integrations in initWorkspace
At this point KWin options are available.
2023-11-27 14:10:15 +00:00
Kai Uwe Broulik
214e471a50 Introduce KillPrompt class
This encapsulates running and querying for the killer helper
and allows to more easily re-use it for Wayland windows.
2023-11-27 14:10:15 +00:00
l10n daemon script
1237b80920 GIT_SILENT Sync po/docbooks with svn 2023-11-27 02:14:17 +00:00
Natalie Clarius
99ff31d3ab plugins/nightcolor: fix wrong changed property insert in DBus interface
BUG: 477482
2023-11-26 11:49:12 +00:00
l10n daemon script
e8a51f9209 GIT_SILENT Sync po/docbooks with svn 2023-11-26 02:55:12 +00:00
l10n daemon script
bc957af28e SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-11-26 02:31:49 +00:00
Kai Uwe Broulik
41659956e7 kcms/rules: Add tooltip when rule name is elided 2023-11-25 19:24:09 +01:00
Nicolas Fella
e8dc372c5f Adapt CI to renamed plasma-framework and kactivities 2023-11-25 15:29:07 +01:00
l10n daemon script
865f081912 GIT_SILENT Sync po/docbooks with svn 2023-11-25 02:10:22 +00:00
Xaver Hugl
301e95b07c backends/drm: unset GAMMA_LUT and CTM when enabling color management
BUG: 477430
2023-11-24 20:50:55 +00:00
Xaver Hugl
673cb16f15 utils: move drm format list to a cpp file
Makes compilation a little bit faster and removes warnings about the unused
function in some files
2023-11-24 16:14:07 +01:00
Vlad Zahorodnii
3ffa3ed0d8 tabbox: Guard against including closed windows when using stacking order
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.
2023-11-24 10:39:46 +02:00
Vlad Zahorodnii
b40b13b661 tabbox: Fix ClientModel::createClientList() reinserting closed windows 2023-11-24 10:39:46 +02:00
Vlad Zahorodnii
4d0d153a57 Always reset tabbox ClientModel if a window is added or removed
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
2023-11-24 10:39:27 +02:00
Vlad Zahorodnii
f3e6d3ca19 Ignore decoration changes of closed windows
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
2023-11-24 10:35:33 +02:00
l10n daemon script
073737bddb GIT_SILENT Sync po/docbooks with svn 2023-11-24 02:12:15 +00:00
Nicolas Fella
8ec88aa3bf Adjust to renamed activities libraries 2023-11-23 21:48:01 +01:00
Jonathan Esk-Riddell
cc4eac4c85 Port to renamed kwayland
https://invent.kde.org/plasma/kwayland/-/merge_requests/107  use renamed kwayland
2023-11-23 19:34:24 +00:00
Xaver Hugl
9e03a219cb platformsupport/scenes/opengl: don't crash when creating the texture fails 2023-11-23 18:46:03 +00:00
Xaver Hugl
985f0edf88 platformsupport/scenes/openglbackend: increase GPU reset timeout again
Apparently it can take a while in some cases, so this commit increases the
timeout to 10s
2023-11-23 17:36:41 +01:00
Vlad Zahorodnii
477102f6bc Fix build with qt dev 2023-11-23 14:27:39 +00:00
Xaver Hugl
593be99207 backends/drm: clear format list before parsing IN_FORMATS property
Otherwise we add the same modifiers every time the properties get updated,
which bloats the list and reduces performance over time
2023-11-23 14:03:03 +00:00
Xaver Hugl
8408dcfad0 core/colorspace: use gamma22 for sRGB content
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.
2023-11-23 13:13:30 +00:00
Nicolas Fella
e7942c3485 Implement bounce keys on Wayland
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
2023-11-23 13:07:35 +00:00
Vlad Zahorodnii
b33c5d9fbb autotests: Prevent sticky keys leaking to other tests 2023-11-23 12:19:31 +00:00
Jarek Janik
ba7875bec2 testStackingOrder: wrap Test::XdgToplevel in a unique_ptr in all tests 2023-11-23 09:53:55 +00:00
Jarek Janik
8e92345840 Add test for BUG: 477262 2023-11-23 09:53:55 +00:00
Jarek Janik
6573275be6 Workspace::raiseWindow: fix order of transients
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.
2023-11-23 09:53:55 +00:00
Nicolas Fella
d4127d07fd Implement locking sticky keys on Wayland
When pressing a latched modifier a second time lock it

When pressing a locked modifier release it

BUG: 464452
2023-11-23 08:17:00 +00:00
l10n daemon script
30f4a197d9 GIT_SILENT Sync po/docbooks with svn 2023-11-23 02:15:34 +00:00
Vlad Zahorodnii
beb2643143 backends/wayland: Throttle configure events
Output resizing is a resource intensive task so throttle it to keep
nested kwin_wayland responsive when it's resized.
2023-11-22 21:40:52 +02:00
David Edmundson
e52163d405 Drop DockLayer concept
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
2023-11-22 16:13:17 +00:00
Vlad Zahorodnii
a01a11fc35 wayland: Reset SurfaceInterface::primaryOutput when the output is removed
CCBUG: 477325
2023-11-22 14:42:59 +00:00
Vlad Zahorodnii
1f32d01a49 Guard against null Group in EffectWindow::group()
Closed windows don't belong to any group.

BUG: 476827
2023-11-22 13:05:54 +02:00
l10n daemon script
3875096d62 GIT_SILENT Sync po/docbooks with svn 2023-11-22 02:11:36 +00:00
Vlad Zahorodnii
15b8fbe604 Preserve relative order of transient siblings
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
2023-11-21 19:26:05 +00:00
Vlad Zahorodnii
41df430aa8 plugins/screentransform: Properly exclude itself from previous screen capture 2023-11-21 19:11:44 +00:00
Vlad Zahorodnii
57ff600c98 plugins/screentransform: Use Output::pixelSize()
It's more accurate than `size * scale`.
2023-11-21 19:11:44 +00:00
Vlad Zahorodnii
b8f2f87672 plugins/screentransform: Drop m_captured flag
It's redundant now. If there's an entry in m_states dictionary for the
given screen, then there's also a valid captured previous frame.
2023-11-21 19:11:44 +00:00
Vlad Zahorodnii
62f904b698 Drop EffectsHandler::renderScreen()
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.
2023-11-21 19:11:44 +00:00