Commit graph

27008 commits

Author SHA1 Message Date
Vlad Zahorodnii
a6743fd2f5 plugins/screencast: Allocate offscreen texture in WindowScreenCastSource::render(QImage) as big as the memfd buffer
textureSize() can temporarily mismatch the target buffer size. It can be
a problem if glGetTexImage() gets called. glGetTexImage() assumes that
the provided buffer is as big as the texture. If it's not, it will write
data outside the bounds of the buffer.

BUG: 489764
2024-07-11 09:49:26 +00:00
Vlad Zahorodnii
abd790c4b5 autotests: Skip testScreencasting in CI
pipewire 1.2 has a known regression where the client's process callback
will not be triggered if the producer has sent only one buffer.

The issue has already been fixed upstream
525360d70a

Until our CI picks up that change, temporarily disable the test to unblock
merging patches.
2024-07-11 09:34:34 +00:00
l10n daemon script
f534aa2d24 GIT_SILENT Sync po/docbooks with svn 2024-07-11 01:26:38 +00:00
Nicolas Fella
6f410383fc Foward modifiers after disabling sticky keys
When disabling sticky keys while a key is latched or locked we unlatch the key, but don't tell the client until the next key event

Call forwardModifiers to tell the client immediately
2024-07-10 10:32:49 +00:00
Nicolas Fella
e14e4a1f8e Fix comment in test
The intent is that the key is *not* locked
2024-07-10 09:35:31 +00:00
Nicolas Fella
463d77ec18 Fix sticky keys for AltGr
We map AltGr to Qt::GroupSwitchModifier, but then ignore it

Instead map it to Mod5, which for some reason xkbcommon doesn't expose a define for

Also, since the Qt modifiers enum doesn't map nicely to XKB modifiers introduce our own enum to avoid confusion

CCBUG: 444335
2024-07-10 09:35:31 +00:00
Vlad Zahorodnii
18535ea959 Track xwayland buffer scale in X11Window
It can happen that when the xwayland scale factor changes, the logical geometry
will remain the same, but the x windows still need to reconfigured to update the
native geometry.

In order to address that, this change makes X11Window track the buffer scale
so if the logical geometry is the same, the x windows will be still reconfigured
with the new xwayland scale.
2024-07-10 07:54:15 +00:00
Vlad Zahorodnii
3f7b26cd9a Use the same logic to configure window during normal resize and interactive resize
X11Window::doInteractiveResizeSync() configures the x windows but it only
does a half of the things that should be done. The rest of it is assumed
to be performed by X11Window::updateServerGeometry() when XSync request is
acked later. The current state is not ideal and error prone.

This change makes X11Window::moveResizeInternal() and X11Window::doInteractiveResizeSync()
share the same code to configure the x windows to simplify the code.

It also drops X11Window::m_last{Frame,Client,Buffer}Geometry to further
simplify the code and make X window geometry tracking even more robust.
2024-07-10 07:54:15 +00:00
Xaver Hugl
706d604305 autotests: add a color pipeline test for identity transformations
If identity transformations aren't properly optimized out, we can have additional
rounding errors and reduced performance. This test ensures that doesn't happen
2024-07-09 20:10:47 +00:00
Xaver Hugl
9f2741af9f core/colorpipeline: make the matrix identity check fuzzy
Otherwise, really small rounding errors can cause the pipeline to be much
more complex than it really needs to be
2024-07-09 19:52:40 +00:00
Vlad Zahorodnii
9ae6ca3481 autotests: Force breeze_cursors cursor theme
Distros like Fedora don't ship Vanilla-DMZ cursor theme.
2024-07-09 17:51:07 +00:00
Vlad Zahorodnii
3492f52179 autotests: Fix cursor shape in PointerInputTest::testMoveCursor()
The cursor during interactive move had been changed to the "grabbing"
cursor shape in d7772031b1.
2024-07-09 17:51:07 +00:00
Alik Aslanyan
3b34e9309b tiling: Don't put maximized windows in tile
After !5532 existing behavior in public scripting API was changed for maximized Windows.
Maximized Windows didn't have a tile on purpose.
This behaviour was changed, as after refactoring separate members for storing QuickTileMode in Window and tile itself were unified
Previously QuickTileMode::Maximize was only set in the Window itself in m_quickTileMode, while tile itself was removed (by setTile(nullptr)).

Current QuickTileMod for current Window isn't part of public scripting API, so it's okay to break it.

This restores compatability with scripts created for KWin 6.0.5 and earlier

BUG: 489463

Signed-off-by: Alik Aslanyan <inline0@pm.me>
2024-07-09 17:24:15 +00:00
Vlad Zahorodnii
230e456ffd plugins/screenshot: Port blitScreenshot() to glReadnPixels()
With glReadnPixels(), it can be guaranteed that the texture data won't
be written beyond the QImage buffer bounds.
2024-07-09 14:16:49 +00:00
Vlad Zahorodnii
d2df8ea9aa autotests: Make testTranslucency less flaky
There's a race condition between the window becoming ready for painting
and testing the translucency animation.
2024-07-09 11:36:10 +03:00
l10n daemon script
51d01a6616 GIT_SILENT Sync po/docbooks with svn 2024-07-09 01:25:34 +00:00
l10n daemon script
1d91268b6e GIT_SILENT Sync po/docbooks with svn 2024-07-08 01:27:00 +00:00
l10n daemon script
c835fd76a3 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-07-08 01:18:27 +00:00
l10n daemon script
f9ad0e9e45 GIT_SILENT Sync po/docbooks with svn 2024-07-06 01:29:25 +00:00
l10n daemon script
ce93b00285 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-07-06 01:18:59 +00:00
Xaver Hugl
f20ccabe80 backends/drm: do blending in gamma 2.2 space with color management too
This matches what we do without color management, and is more what users and app
developers expect. Going with linear blending before was mostly from it being more
"correct" / how physical blending of light works, but that doesn't really matter
when existing software expects it to behave differently.

BUG: 476868
CCBUG: 479755
2024-07-05 14:52:47 +02:00
Xaver Hugl
5b86dba6bf backends/drm: support arbitrary input transfer functions in the icc shader 2024-07-05 14:52:47 +02:00
Vlad Zahorodnii
50717a2f9a plugins/screencast: Clean up cursor scale tracking
Poll the screen cast scale from the source rather have code on top of
ScreenCastStream and ScreenCastSource that figures out by itself how the
cursor should be scaled. It ensures that the cursor size will be
consistent and it makes the ScreenCastStream initialization code simpler.
2024-07-05 07:08:48 +00:00
Kai Li
e4a272e166 wayland: add error handling for QFile::open failure in org_kde_plasma_window_get_icon
when creating a QDataStream object, if the file has not been successfully opened
before (file.open() fails), the created QDataStream object 'ds' may not function
properly. If you continue to perform the operation 'ds << icon;' in this case,
it may cause kwin to crash. Therefore, it is essential to ensure that the file
has been successfully opened before creating the QDataStream object.

Signed-off-by: likai <likai@kylinos.cn>
2024-07-05 09:33:01 +08:00
l10n daemon script
23e1f10c22 GIT_SILENT Sync po/docbooks with svn 2024-07-05 01:25:28 +00:00
Nate Graham
b0970bd6c7 kcms/desktop: make list items conform to HIG
* Use correct deletion icon (this isn't a file).
* Use alternating list backgrounds to help line up the content on the
  left and right.
2024-07-04 11:09:27 -06:00
Xaver Hugl
40f50c9d0f placement: ignore the active output with place under mouse
BUG: 488110
2024-07-04 18:44:14 +02:00
Xaver Hugl
8c97c4dd31 backends/drm: move virtual outputs out of DrmGpu
They're not related to each other in any way
2024-07-04 16:25:14 +00:00
Xaver Hugl
0704319235 backends/drm: use the post-blending color pipeline for direct scanout
This makes direct scanout of SDR content on an HDR screen and vice versa possible,
as well as direct scanout while night color is active or the brightness isn't 100%.
2024-07-04 17:39:33 +02:00
Xaver Hugl
2799c270b4 backends/drm: implement support for post blending color pipelines
This exposes the degamma->ctm->gamma pipeline as a drm color op, which can
be set to a generic color pipeline. The same code can later be adapted to
program the upcoming per-plane color pipeline properties.
2024-07-04 17:39:10 +02:00
Xaver Hugl
5aaab715b0 core: add color pipeline class
This allows encapsulating color operations in a generic way, which can then be used in KMS or shaders.
The class automatically optimizes out unnecessary color operations like identity matrices, and
combines consecutive operations like
- matrix + matrix
- multiplier + multiplier
- matrix + multiplier
- EOTF + inverse EOTF
- relative EOTF + multiplier
to improve efficiency and make KMS offloading easier
2024-07-04 17:39:10 +02:00
Xaver Hugl
de85867675 core: add a TransferFunction class and move transfer function functions in there
This way it's more obvious where to find them, and the class can be extended with more
functionality later, like transfer functions with parameters
2024-07-04 17:19:31 +02:00
Xaver Hugl
372ea85326 bump clang-format to C++ 20
Otherwise it formats some newer C++ features wrong
2024-07-04 16:29:25 +02:00
Vlad Zahorodnii
9ce095dad3 opengl: Add OpenGlContext::glGetnTexImage()
Add glGetnTexImage() to be consistent with other robustness stuff.
2024-07-04 17:12:16 +03:00
Vlad Zahorodnii
74d7c33a97 plugins/screencast: Prefer glReadnPixels() and glGetnTexImage()
They should prevent potentially writing texture data outside the bounds
of the memfd buffer.
2024-07-04 17:11:38 +03:00
Vlad Zahorodnii
b452a5a5fb plugins/screencast: Hide cursor if another window covers screencasted window
BUG: 487294
2024-07-04 13:50:45 +00:00
Vlad Zahorodnii
8cb7e0a26b Simplify X11Window::updateServerGeometry()
There are two shapes that the WM needs to be concerned about: the input
shape and normal shape.

If the client window has custom input shape, the window manager should
synchronize it with all parent windows or ensure that its frame window
has an input shape as big as the client's input shape. The input shape
needs to be updated either when the client changes it or when the
X11Window is resized or its borders have changed. updateInputShape()
accomplishes that.

The normal shape is slightly different. If the window is decorated, the
window manager could ignore the shape set by the client. If the window
is not decorated, it's a good idea for the WM to synchronize client's
shape with the frame window's shape (if there's any). The frame window
shape doesn't need to be updated when it's resized, but if the client
window moves inside the frame window, it needs to be updated.

This change removes too generic updateShape() in the
X11Window::moveResize() code path and replaces it with a more targeted
code to update the shape, so updateServerGeometry() does not emit the
shapeChanged signal and it can be reused in the doInteractiveResizeSync()
function. Note that on wayland, it's unnecessary to synchronize the
shapes because the client window never moves in the frame window but it
is done anyway to minimize the differences between X and Wayland sessions
for easier maintenance.
2024-07-04 11:27:59 +00:00
l10n daemon script
9d9c7fe883 GIT_SILENT Sync po/docbooks with svn 2024-07-04 01:26:29 +00:00
Akseli Lahtinen
a99e1b6622 WindowHeapDelegate: label topMargin to small, remove height padding
This should help avoiding the window heap delegaet labels drawing on top
of each other in Overview effect.


BUG:489595
2024-07-03 20:33:09 +00:00
l10n daemon script
24613d0dd8 GIT_SILENT Sync po/docbooks with svn 2024-07-03 01:29:03 +00:00
l10n daemon script
ec43eb08df 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-07-03 01:19:51 +00:00
Xaver Hugl
64d70029ec plugins/glide: drop references to closed windows if they're not animated
Otherwise the window might still be referenced from the opening animation, which
can lead to the effect wrongly keeping a reference to the window and staying active.

CCBUG: 485425
2024-07-02 23:52:21 +02:00
Vlad Zahorodnii
465873ecac plugins/screencast: Handle frame rate throttling timer firing a bit earlier
The QTimer can fire a bit earlier than expected. If that happens, don't
try to start it again, but record a frame instead.

CCBUG: 489602
2024-07-02 13:54:58 +00:00
Xaver Hugl
b103decda2 backends/drm: test and apply all mode changes at once
This avoids doing multiple atomic tests with outdated state for when multiple
outputs change simultaneously, and avoids crashing because outputs get used
before they're fully constructed
(https://crash-reports.kde.org/organizations/kde/issues/40960)
2024-07-02 14:59:06 +02:00
Vlad Zahorodnii
84e3ff88c3 Round X window gravity adjustment
Qt applications use Static window gravity by default. This means that if
a window decoration is created, the client window should remain at the same
position in the global coordinate space. To do that, X11Window needs to
move the frame geometry by (-borderLeft(), -borderTop()).

On the other hand, after making X11Window::framePosToClientPos() round
the window borders, the client window can end up being moved more than
expected when applying the gravity adjustment.

This change makes X11Window also round the gravity adjustment so the math
is consistent there and in the framePosToClientPos() function.

BUG: 489016
2024-07-02 11:25:50 +00:00
l10n daemon script
282137c41d GIT_SILENT Sync po/docbooks with svn 2024-07-02 01:28:03 +00:00
l10n daemon script
d1bac279de 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-07-02 01:18:59 +00:00
Marco Martin
9f7e30652c Don't assert on null output
don't blindly access m_tileManagers as it can assert
with out of bounds when output is not valid. This can happen
from scripting side as this function is wrapped in the javascript api.
2024-07-01 11:44:53 +00:00
Erwin Saumweber
d4152fafbd quicktiling: Reset layout when last quicktile ceases to exist
To not preserve invisible splits, last quicktile is differentiated
per split axis.

BUG: 465937
2024-07-01 07:53:06 +00:00
l10n daemon script
fa4b75804b GIT_SILENT Sync po/docbooks with svn 2024-07-01 01:26:44 +00:00