Commit graph

27334 commits

Author SHA1 Message Date
Vlad Zahorodnii
fc1f53895f Add an assert in Window::unref() 2024-08-29 13:24:04 +00:00
Kai Uwe Broulik
54cb3407d3 plugins/outputlocator: Add outline to frame
Ensures a contrast between a window behind it, e.g. the KScreen KCM.
2024-08-29 13:06:45 +00:00
l10n daemon script
d24ec2a335 GIT_SILENT Sync po/docbooks with svn 2024-08-29 01:30:16 +00:00
Thomas Duckworth
3b918b4409 plugins/colorblindnesscorrection: mark as internal and remove configuration UI
Depends on https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2472
as it's being moved to the Accessibility KCM for greater… accessibility!

CCBUG: 488771
2024-08-28 23:56:23 +00:00
Christoph Wolk
0cb70c8d36 kcms/decoration: use sentence case for combobox
The HIG recommend sentence case for combobox entries. The window border
combobox in the decoration kcm currently uses title case, except for the
option following the theme default, which uses mixed title and sentence
case.

This change converts the labels to sentence case. The "Theme's default"
option is also renamed to "Theme default", as this is a shorter and more
common construction in UI strings.
2024-08-28 21:50:04 +00:00
Vlad Zahorodnii
3ce9b1b872 plugins/qpa: Suppress warnings about raise()/lower() not being implemented
We write window code with an assumption that the compositor will do the
right thing when a window is shown or hidden or activated, so our qpa can
leave stub implementations for raise() and lower() to suppress the
warnings produced by the stack manipulation functions in Qt.
2024-08-28 17:34:21 +03:00
Aleix Pol Gonzalez
6c4ded2034 input: Allow different surfaces to be interacted in parallel by touch
While on pointers and keyboards the focus patterns follows rather
naturally, on touch screens it doesn't so much.
This change adapts our touch infrastructure to allow for multiple
surfaces to be issued touch events without forcing all interactions into
the same one.

Signed-off-by: Victoria Fischer <victoria.fischer@mercedes-benz.com>
2024-08-28 09:36:51 +00:00
Aleix Pol Gonzalez
912d339489 window: Extend API documentation
Signed-off-by: Victoria Fischer <victoria.fischer@mercedes-benz.com>
2024-08-28 09:36:51 +00:00
l10n daemon script
c2d28d5b96 GIT_SILENT Sync po/docbooks with svn 2024-08-28 01:40:22 +00:00
l10n daemon script
4d66241fb0 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-28 01:29:03 +00:00
Christoph Wolk
5ae746eef2 kcms/screenedge: use sentence case for combobox
The HIG recommend that comboboxes use sentence case. The Screen Edges
kcm has a combobox that allows users to configure when to switch
desktops by moving to the edge, which uses title case for its entries.

This change makes this combobox use sentence case for its labels.
2024-08-27 15:29:58 +00:00
Vlad Zahorodnii
ca5aa60791 utils: Adapt to svg cursor format changes 2024-08-27 14:56:57 +00:00
Vlad Zahorodnii
b26eb86310 utils: Make hotspot in CursorTheme QPointF
As far as I know, the reason that the CursorTheme provides a QPoint
hotspot is mostly due to the historical reasons. At the time, all
hotspot math had relied upon integer hotspots. After
4cd25cf571 it is no longer the case.
2024-08-27 08:18:17 +00:00
l10n daemon script
5837d042c9 GIT_SILENT Sync po/docbooks with svn 2024-08-27 01:33:04 +00:00
Vlad Zahorodnii
a418d2f13e plugins/synchronizeskipswitcher: Fix Window::skipTaskbarChanged handler
The Window::skipTaskbarChanged signal no longer has a Window argument.

BUG: 465600
2024-08-26 13:38:29 +00:00
Vlad Zahorodnii
276baa7dd5 Fix null dereference in Workspace::workspaceEvent()
If Xcb::CurrentInput fails for some reason, the "->" operator will return
null.
2024-08-26 13:17:13 +00:00
l10n daemon script
636cbbe024 GIT_SILENT Sync po/docbooks with svn 2024-08-26 01:41:00 +00:00
Vlad Zahorodnii
1e7cfc1d19 Fix directScanout getting shadowed
Amends 7ab825cba1.

This shadow "directScanout" variable breaks

    if (!directScanout) {
        if (!m_backend->present(output, frame)) {
            m_backend->repairPresentation(output);
        }
    }

which can result in present() function getting called twice with the
same `OutputFrame` object: first, at line 359, and the second time at
line 386. That, in its turn, would queue two drm commit objects with
the same OutputFrame and then the behavior is undefined.
2024-08-25 15:41:00 +00:00
Vlad Zahorodnii
5276801d5e core: Add a m_presented assert in OutputFrame::presented()
presented() must be called at most once.
2024-08-25 15:07:10 +00:00
l10n daemon script
35d4ac716c GIT_SILENT Sync po/docbooks with svn 2024-08-25 01:29:59 +00:00
Jin Liu
31fac8493e utils: get svg cursor nominal size from metadata
Instead of assume it to be 24.
2024-08-24 14:54:45 +00:00
l10n daemon script
b88bce1b2e GIT_SILENT Sync po/docbooks with svn 2024-08-24 01:30:21 +00:00
l10n daemon script
59881f31a0 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-24 01:22:08 +00:00
Yifan Zhu
af8de6be74 KeyboardLayout: always set componentDisplayName for shortcut
Otherwise the last call uses the default, which overrides the previous
calls.

Test plan:
- Go to system settings - shortcuts
- Verify the category for layout switching is now correctly called
  "Keyboard Layout Switcher"

CCBUG: 492019
2024-08-23 14:54:26 +00:00
Xaver Hugl
eaf7e9a3a2 core/colorspace: be more robust about edge cases
xyz -> xy and xy -> xyz conversions have divisions in them, so we need to
handle the edge cases of the divisor being zero. This can happen if an ICC
profile is invalid, or if the XYZ color space is used.
2024-08-23 10:45:46 +00:00
David Edmundson
99f2cd2f51 Revert "wayland: Revert send pointer leave on drag"
Now we have server-side cursor icons, we can send the pointer leave.

This reverts commit 9302e84b95.
2024-08-23 09:42:05 +00:00
David Edmundson
0726ae6cfa server side drag icons 2024-08-23 09:42:05 +00:00
Vlad Zahorodnii
f8d8589ce7 Add missing size check in Placement::placeZeroCornered()
The size is required to cascade the window.
2024-08-23 09:01:56 +00:00
Vlad Zahorodnii
913a850584 Add missing size check in Placement::placeOnScreenDisplay()
In order to center a window, kwin needs to know the window size.
2024-08-23 09:01:56 +00:00
Vlad Zahorodnii
6379b8b01a Clean up Placement::placeSmart()
Avoid using Window::frameGeometry() because its position is invalid.

In the future, the XdgToplevelWindow would need to run the placement
code before updating the Window::frameGeometry(). In order to prepare
for that, this change also makes placeSmart() pull the window size from
a cached QSizeF() object.
2024-08-23 09:01:56 +00:00
Vlad Zahorodnii
646f071291 Clean up Placement::placeCascaded()
Avoid using Window::frameGeometry() because its position is invalid.

In the future, the XdgToplevelWindow would need to run the placement
code before updating the Window::frameGeometry(). In order to prepare
for that, this change also makes placeCascaded() pull the window size
from a cached QSizeF() object.
2024-08-23 09:01:56 +00:00
Vlad Zahorodnii
3810811730 Stop Placement::cascadeIfCovering() from changing window geometry
The main motivation behind this change is to ensure that every placeXyz()
function issues only one move() or moveResize() function so the placement
code is more refactorable, and in general, it's a good idea to avoid
changing the geometry until the final geometry is finally known.

Note that it changes the behavior of placeOnMainWindow() and
placeUnderMouse(). Those methods will not anymore potentially resize
the window. It was done to avoid a flicker glitch on Wayland. This is
the responsibility of the caller (X11Window) to further inspect whether
the window needs to be resized. However, for now, let's keep things
simple and revisit this if somebody actually complains about it.
2024-08-23 09:01:56 +00:00
Vlad Zahorodnii
4258797402 Port Workspace::cascadeOffset() away from Window::frameGeometry()
Workspace::cascadeOffset() can be called by placement code before the
frame geometry has a valid position. That is wrong. In order to avoid
that, use the placement area that we are given.
2024-08-23 09:01:56 +00:00
l10n daemon script
428c4c4fd1 GIT_SILENT Sync po/docbooks with svn 2024-08-23 01:30:02 +00:00
l10n daemon script
149b49f160 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-23 01:22:02 +00:00
Xaver Hugl
d0c4aeeb08 options: enable separate screen focus by default
When the user closes the active window, with separate screen focus disabled, a
window on the other screen might get activated, which also switches the active
screen to the other one. As this is quite unintuitive, and in my testing having
separate screen focus enabled didn't have any other unintuitive side effects,
this commit enables separate screen focus by default
2024-08-23 00:33:01 +02:00
Xaver Hugl
c3c3f56e98 implement a proper tone mapping algorithm
Instead of just clipping when HDR content is brighter than the maximum luminance the
screen can show, when HDR metadata indicates this could happen, KWin now
- converts the rgb colors to ICtCp, to split luminance and color
- applies a tone mapping curve that maps the intensity component from
 - [0, reference] to [0, newReference] linearly
 - [reference, max content luminance] to [newReference, max display luminance] nonlinearly
- converts the resulting ICtCp color back to rgb

The result is that HDR content looks much, much better on SDR displays, at least when decent
HDR metadata is provided.
As wrong metadata could cause this tone mapping to wrongly kick in in games for example, the
environment variable KWIN_DISABLE_TONEMAPPING is provided to disable tone mapping and fall back
to clipping again instead.
2024-08-22 23:04:00 +02:00
Vlad Zahorodnii
e03fb08bcc utils: Validate svg cursor metadata better
Metadata array must contain at least one item.
2024-08-22 16:50:27 +03:00
Vlad Zahorodnii
5cff8cd2d1 utils: Assume that the top object in svg cursor metadata is an array
This adapts the svg cursor loading code to the recent metadata format
changes.
2024-08-22 14:07:56 +03:00
Vlad Zahorodnii
95611189d5 effect: Refuse starting quick effect if keyboard cannot be grabbed
If effects->grabKeyboard() fails and effects->ungrabKeyboard() is called
later, kwin will crash due to an assert in the ungrabKeyboard() function.

This matters only on X11.
2024-08-22 07:25:21 +00:00
l10n daemon script
d474a6795b GIT_SILENT Sync po/docbooks with svn 2024-08-22 01:35:59 +00:00
l10n daemon script
f781d48d86 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-22 01:22:58 +00:00
Xaver Hugl
e7780f1ab3 backends/drm: implement damage tracking for the color management shadow buffer
This significantly reduces the amount of pixels that have to be repainted in most frames
while an ICC profile is set.

BUG: 477223
2024-08-21 23:01:00 +02:00
Vlad Zahorodnii
d56dbb04e6 Use for range based loop in X11Window::restackWindow() when traversing through stack
It's more readable and it also makes code more refactorable. For example,
if somebody makes Workspace::stackingOrder() return a normal QList, KWin
won't crash at this code.
2024-08-21 20:39:25 +03:00
Vlad Zahorodnii
0622526e8f Drop "send_event" boolean trap in X11Window::restackWindow()
The synthetic ConfigureNotify event is not sent when the stack mode is
TopIf and BottomIf, i.e. the way the restackWindow() function handles
the "send_event" argument is inconsistent.

And the window manager doesn't have to send a synthetic configure event
when processing a _NET_RESTACK_WINDOW client message. It must do it only
after handling a ConfigureRequest request, which
the X11Window::configureRequestEvent() function already does.

So rather than fixing the handling of the "send_event" argument, this
change removes that boolean trap instead.
2024-08-21 17:14:02 +00:00
Vlad Zahorodnii
eff06e4109 Drop Workspace::lowerWindowRequest(Window *window)
It's unused.
2024-08-21 16:59:37 +00:00
Vlad Zahorodnii
4a14644885 Guard Workspace::raiseWindowRequest() with a KWIN_BUILD_X11 ifdef
raiseWindowRequest() is an X11 specific detail.
2024-08-21 16:59:37 +00:00
Vlad Zahorodnii
ef9d3a1cd0 Add safety guards in FocusChain::move{After,Before}Window()
If the `window` is the same as the `reference`, the `window` will be
inserted at index "-1", which is wrong.
2024-08-21 16:28:37 +00:00
Vlad Zahorodnii
22e10f6efb Correct traversal order in FocusChain::moveAfterWindowInChain()
The first item in the `chain` list corresponds to the last item in
the focus chain. The last item in the `chain` list corresponds to
the first item in the focus chain.

Given that, we need to traverse the list from the start to the end in
order to find the first window owned by the same app as `reference`.
2024-08-21 16:17:18 +00:00
Xaver Hugl
1c7c16f28b core/renderloop: add a debug print for presentation mode changes
It can be useful for debugging and these changes don't happen too often
2024-08-21 16:02:19 +00:00