Commit graph

27210 commits

Author SHA1 Message Date
Xaver Hugl
4759ec6089 wayland: implement the alpha-modifier protocol
The alpha modifier protocol allows clients to set a multiplier for the opacity
of a surface, which allows them to offload some operations to KWin, which
in turn may offload them to KMS in the future
2024-08-14 14:26:33 +02:00
Xaver Hugl
370c9c8953 window: make setQuickTileMode more sane
...by removing the keyboard flag, moving keyboard shortcut handling into a separate
method and making the position to tile the window at explicit

This also means KWin doesn't do as many intermediary changes to window geometry on output
hotplugs, which may work around some clients not always reacting to no-op changes.

CCBUG: 479694
2024-08-14 11:38:07 +00:00
Xaver Hugl
16ff6d777a wayland/xx colormanagement: add all the missing color spaces 2024-08-14 11:07:20 +00:00
Xaver Hugl
f3d4778bc9 wayland/xx colormanagement: remove ext_srgb and rec.709 transfer functions
I'm not sure if we handle them correctly, and there's no test client nor autotest.
They can be added back later when we have that
2024-08-14 11:07:20 +00:00
Xaver Hugl
4fc6a5bd51 wayland/xx colormanagement: don't clamp primaries to 1
The range of values is [0, 10'000], clamping to 1 just makes all primaries 1
2024-08-14 10:52:08 +00:00
Vlad Zahorodnii
94b2c5e50e scene: Fix SurfaceItemWayland::freeze()
When a wl_surface is unmapped, we need to stop updating the buffer
in SurfacePixmapWayland.

However, SurfaceItemWayland::freeze() doesn't unset m_surface, so
the SurfacePixmapWayland keeps updating the buffer even after the
surface is unmapped. This results in some closed windows losing their
contents when playing a window closing animation.
2024-08-14 12:36:06 +03:00
l10n daemon script
883fde4298 GIT_SILENT Sync po/docbooks with svn 2024-08-14 01:30:53 +00:00
l10n daemon script
dd698378ea 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"
2024-08-14 01:21:58 +00:00
Xaver Hugl
d8e1637dcd plugins/invert: adjust to colormanagement.glsl changes
The current version didn't compile, because the nitsToEncoding and encodingToNits expect
different arguments than before
2024-08-13 21:28:38 +00:00
Vlad Zahorodnii
298486d47a wayland: Pass private-code to waylandscanner
The main goal is to avoid leaking our private xyz_interface objects.
2024-08-13 19:59:11 +00:00
Thomas Duckworth
4019989959 kcms: Use flat QGroupBoxes and set documentMode on QTabWidgets
Makes it consistent with other KCMs and and Kirigami KCMs.

**Before:**

![Screenshot_20240809_181201.png](/uploads/ff17bdcbdacda38d4abe752054d7f6d2/Screenshot_20240809_181201.png){width=431 height=399}![Screenshot_20240809_181210.png](/uploads/2e360efae4dd8982ab0a7b7af7ec85b4/Screenshot_20240809_181210.png){width=430 height=398}![Screenshot_20240809_181155.png](/uploads/6f534ffad87350a4d8fd47735f1c8c60/Screenshot_20240809_181155.png){width=431 height=399}

**After:**

![Screenshot_20240809_181243.png](/uploads/94babd127faaa8021054b7c46c806f93/Screenshot_20240809_181243.png){width=433 height=358}![Screenshot_20240809_181251.png](/uploads/25bd2d99ada694173ba875006dbe57bc/Screenshot_20240809_181251.png){width=436 height=361}

![Screenshot_20240809_181236.png](/uploads/03f0fb73e357728ae558649381cecdf7/Screenshot_20240809_181236.png){width=443 height=367}

@teams/vdg
2024-08-13 18:04:14 +00:00
Vlad Zahorodnii
989b9a520d Fix a copy paste typo 2024-08-13 13:53:32 +00:00
Vlad Zahorodnii
55b50a3e2b Handle other data source types in the debug console clipboard tab 2024-08-13 13:53:32 +00:00
Vlad Zahorodnii
95a8163c5b qpa: Implement clipboard
This allows copy pasting text between the overview and regular clients.

QMimeData::data() has a synchronous API. It is a problem for us, the
compositor, because it means we need to block the main thread to read
the mime data. This change adds a one second timeout. If no data arrives
within the next 1 second, the qpa will give up in order to avoid freezing
the screen further. Not sure how this can be handled better without
changing the API of the QMimeData to add async overloads.

BUG: 445751
2024-08-13 13:53:32 +00:00
l10n daemon script
7d4e993155 GIT_SILENT Sync po/docbooks with svn 2024-08-13 01:29:38 +00:00
l10n daemon script
4ee06acf22 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"
2024-08-13 01:21:38 +00:00
Xaver Hugl
96ed79fd62 backends/drm: fix ICC profiles not being applied
The check for a shadow buffer used a variable before it was set to the new value,
and the shaders are broken for some reason, so I reverted them to use the previous
code with only the transfer function parameters added.
2024-08-12 21:07:19 +00:00
Xaver Hugl
992547fd10 wayland/frog colormanagement: don't change the reference luminance for relative transfer function
We only need to override the reference luminance for "absolute" transfer functions, because most
Vulkan apps - games - don't adhere to the standards in this aspect.
For relative transfer functions, the reference luminance should match the maximum luminance of the
transfer function.
2024-08-12 20:05:28 +02:00
Xaver Hugl
cfc0f05c94 placeholderinputeventfilter: don't block media keys
While blindly typing with no outputs connected is unlikely to be intentional,
using the media keys likely is.

BUG: 491531
2024-08-12 13:44:03 +00:00
Nate Graham
85f2e85fe4 plugins/screenedge: Improve user-facing strings
This effect's name and description are a bit ambiguous right now; let's
bulk them up so it's clearer to users what this effect does.
2024-08-12 13:26:26 +00:00
Marco Martin
01d7ddff68 Slight refactor of ExpoLayout
ExpoCell is a QQuickItem which manages the geometry of window
thumbnails, movig a bit of the logic in the c++ part.

The partialActivationFactor property switches between the geometry of the window and the
geometry it will have in the overview grid

Get rid of the complicated, 2-stage state machine that the delegate had
2024-08-12 13:09:41 +00:00
Xaver Hugl
e48b7b77ec effect/animationeffect: use ItemEffect to prevent direct scanout where applicable 2024-08-12 12:13:31 +00:00
Xaver Hugl
2a5716e782 effects/animationeffect: port to stl containers
We need to attach non-copyable data to animations, and Qt containers don't work for that
2024-08-12 12:13:31 +00:00
Xaver Hugl
18f1092728 scene/item: add ItemEffect
Right now it's just a helper to mark items as being affected by some effect,
to prevent direct scanout of the relevant item without needing to block direct
scanout for the whole screen
2024-08-12 12:13:31 +00:00
Xaver Hugl
418143a45b core/colorspace: move Colorimetry::toOther to ColorDescription
With some rendering intents we need to apply behavior based on brightness levels
or the SDR colorimetry
2024-08-12 11:46:32 +00:00
Xaver Hugl
833476a111 core/colorspace: add rendering intents
Rendering intents describe how to handle mapping between different colorspaces,
what to do with out of gamut values and what to do if the whitepoint doesn't match.
This way, clients can choose which behavior their content should get.
2024-08-12 11:46:32 +00:00
Nicolas Fella
e9680f6425 xkb: Remove declared but not defined method 2024-08-12 10:52:07 +00:00
Yifan Zhu
8d5f46a719 plugins/trackmouse: listen to mouse events when active
Previously TrackMouseEffect only listens to mouse events if there are
modifiers configured. So when it was activated by shortcut, the effect
doesn't follow mouse movements.

Instead, listen to mouse events when the effect has been activated, or
if any modifier is configured.

BUG: 487820
2024-08-11 23:54:02 -07:00
l10n daemon script
f86f7eba32 GIT_SILENT Sync po/docbooks with svn 2024-08-12 01:29:03 +00:00
l10n daemon script
2ef1f98c55 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"
2024-08-12 01:21:13 +00:00
l10n daemon script
a7d68752b9 GIT_SILENT Sync po/docbooks with svn 2024-08-11 01:32:23 +00:00
l10n daemon script
e783dc20d6 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"
2024-08-11 01:23:06 +00:00
David Edmundson
7e23386d46 xwayland: Drop outdated guard against clipboard races
This guard was added as part of d335070b80.

The guard as-is does not work correctly. If a client quits at the wrong point
or simply never responds to the request for targets, we get into a stuck state
where we will never update the clipboard from Wayland to X again until the
selection owner changes.

The guard appears to be outdated: The rationale given in the original MR was
that it prevented a race where:
 1. The X11 clipboard changes
 2. We start fetching targets
 3. We notify Wayland clients that the clipboard changed is now empty
 4. Klipper replaces the clipboard
 5. Kwin then replaces the X11 clipboard
 6. X11 finishes fetching targets, but this is now discarded as there's a new
X11 clipboard

However we can not find a path for step 2 to happen in the current codebase.
Potentially due to one of many refactors over the past few years.
The wayland selection is only replaced when targets are fully loaded.

The only way it could happen is if an X11 client replaced the clipboard by
explicitly deleting the old selection first, but this also does not appear to
happen in any tested apps.

BUG: 490577
2024-08-10 21:53:04 +00:00
l10n daemon script
516e60948a GIT_SILENT Sync po/docbooks with svn 2024-08-10 01:38:14 +00:00
l10n daemon script
1dffd8e85a 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"
2024-08-10 01:28:13 +00:00
Aleix Pol Gonzalez
e2ef47031c Only look up X11 if it's needed
Do not look it up if KWIN_BUILD_X11=OFF.

Signed-off-by: Falko Becker <falko.becker@mbition.io>
2024-08-09 16:33:51 +02:00
Xaver Hugl
41dc1126ba wayland/xx-colormanagement: add support for custom luminance levels
This also adds support for the linear transfer function, as it can now be used for scRGB,
and it fixes passing on the mastering display primaries and luminance levels.
2024-08-09 15:19:20 +02:00
Xaver Hugl
6bd07ad6b3 backends/drm: remove the shadow buffer when possible, and reduce it to 10bpc when not
Using the custom values for min. and max. luminance in transfer functions, we can reduce the
ranges of values in the shadow buffer to be limited to [0, 1], and with that we can switch
from a floating point buffer back to a normalized format. As gamma 2.2 encoding is much more
efficient at storing color values, this also drops the buffer from 16bpc down to 10bpc.

Furthermore, this offloads the gamma 2.2 -> PQ conversion to KMS when possible, and then uses
the scanout buffer with gamma 2.2 encoding directly. This way the shadow buffer gets completely
skipped and performance and efficiency get improved a lot.

BUG: 491452
CCBUG: 477223
2024-08-09 15:18:43 +02:00
Xaver Hugl
2cbf4543fa autotests: add very basic color pipeline test
It just tests rec.709 <-> rec.2020 at 0%, 50% and 100% rec.709 luminance, to have
a very simple indicator for when something's gone really wrong while working on
color pipeline changes
2024-08-09 15:10:45 +02:00
Xaver Hugl
bea4d1064c core: add transfer function minimum and maximum luminance values
This redefines the transfer functions to have a custom luminance at encoded
value zero, and a custom luminance at encoded value 1, neither of which are
tied to the reference luminance, even for relative transfer functions.

The goal of that is that we can use a gamma 2.2 transfer function for the shadow
buffer, with the reference luminance being much lower than the maximum luminance.
For example, on an HDR screen you might have the reference luminance of 600 nits,
while the maximum luminance is 1000 nits. By representing this in gamma 2.2, we
can use a much smaller amount of bits per color to store the values than if we
used a linear transfer function. An additional benefit is that this way the values
in the buffer can be scaled by arbitrary amounts, for example to limit the range of
values to [0, 1], which can be represented in a normalized buffer
2024-08-09 15:10:45 +02:00
l10n daemon script
3e4d9ce939 GIT_SILENT Sync po/docbooks with svn 2024-08-09 01:30:10 +00:00
l10n daemon script
e674521061 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"
2024-08-09 01:22:15 +00:00
Aleix Pol Gonzalez
4e1422826f main: Allow building without QtX11Info
Seems some of it is in QtGui/private.

Signed-off-by: Falko Becker <falko.becker@mbition.io>
2024-08-08 12:30:53 +02:00
l10n daemon script
99ca6c03d6 GIT_SILENT Sync po/docbooks with svn 2024-08-08 01:31:54 +00:00
l10n daemon script
51b5fa1e74 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"
2024-08-08 01:22:12 +00:00
Yifan Zhu
7752db3a88 screenedge: allow activating clients in drag and drop
In particular, this allows dragging onto autohide and dogde-window
panels.

BUG: 450579
2024-08-07 16:29:55 +00:00
Nicolas Fella
9d76423285 Initialize KCrash after setting KAboutData
So that KCrash can report the application version
2024-08-07 14:25:52 +02:00
Vlad Zahorodnii
68a621f95a utils: Rename KXcursorTheme to CursorTheme
The KXcursorTheme type no longer with Xcursor only cursors, so rename it
to maintain more reasonable naming conventions.
2024-08-07 11:57:39 +03:00
Vlad Zahorodnii
266c6ee855 utils: Add support for svg cursors
With this change, KXcursorTheme will be able to load svg cursors provided
by breeze.

If a cursor theme provides both xcursor cursors and svg cursors, the svg
cursors will be preferred.

At the moment, KXcursorTheme doesn't cache svg render results but it could
do that if it becomes a noticeable issue.
2024-08-07 11:57:39 +03:00
Vlad Zahorodnii
e7c1144e2c plugins/shakecursor: Increase max cursor scale
Currently, the embedded cursors have effectively a scale factor of 10.
So they look smooth even though the current maxScale is small. With the
svg cursors, the shake cursor needs to provide more reasonable maxScale
values.
2024-08-07 11:57:39 +03:00