Commit graph

1719 commits

Author SHA1 Message Date
Vlad Zahorodnii
b1908949d0 autotests: Use ShapeCursorSource to load reference cursor images in testPointerInput 2024-02-07 08:46:20 +00:00
Vlad Zahorodnii
c9c84b6859 Prefer cursor shape names from the CSS W3C specification
There is a mix of cursor shape names from the CSS W3C specification and
non-spec ones, which is confusing when deciding what cursor shapes need
aliases in Cursor::cursorAlternativeNames().
2024-02-07 08:35:52 +00:00
Vlad Zahorodnii
aac5d562fb Drop "<N>" window caption suffix
The current implementation of the `<N>` suffix is still buggy and its
benefits are doubtful. One could argue that visual aids such as window
thumbnails or highlighting the windows are better. On its own, these
numbers don't have strong connections to the windows and can change on
a whim.
2024-02-05 11:10:53 +02:00
Xaver Hugl
67b1a88466 autotests/integration: re-enable lid closed output changes test
KWin is handling the lid switch now
2024-02-02 01:59:36 +01:00
Xaver Hugl
9c0085f5a9 colorspace: make sdr colorimetry not be about rec.2020 anymore
This was just done because of the wrong assumption that displays needed that
to show the full native gamut. That turned out to be an amdgpu bug though; with
that fixed, most of the 0-100% range is wildly oversaturated.
To make the slider more intuitive, this changes the sdr gamut wideness to instead
interpolate to the native display primaries as indicated by the EDID.
2024-01-31 13:23:03 +01:00
Vlad Zahorodnii
def3a50558 Ignore external updates of _NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES
At the moment, the desktop layout in _NET_DESKTOP_LAYOUT overwrites new
desktop layout with outdated information. This happens because kwin tries
to honor the desktop layout set by the pager. However, kwin itself
already acts as the pager. The pager applet in plasma doesn't attempt to
maintain _NET_DESKTOP_LAYOUT with proper values.

On the other hand, kwin trying to both update and also sync its state to
_NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES has created a series of
issues, like lockups or rendering glitches.

Given that the window manager can ignore these properties, and the fact
that kwin already does act like a pager, this patch makes kwin ignore
external updates to _NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES.

In order to modify the desktop layout on X11, use the dbus api. On
Wayland, either the dbus api or the virtual desktop wayland protocol.

BUG: 422319
BUG: 480371
2024-01-30 14:14:09 +02:00
Vlad Zahorodnii
e23cb52a16 wayland: Add windows when readyForPainting changes
A window is added to the workspace when it's mapped. It's assumed that
the first Window::windowShown signal indicates that. But it's not
entirely true. For example, if setHidden(false); setHidden(true); are
called in succession, the window will be marked as ready for painting
even though it isn't.

The Window::readyForPaintingChanged() signal fixes that. It's emitted
when the window is actually mapped.
2024-01-29 12:35:10 +02:00
Vlad Zahorodnii
2d399e93f0 Relax constraints for screen edges reserved by windows
At the moment, if the workspace extends or shrinks by an output, the
hidden panel will be shown. It doesn't make sense in all cases.

Furthermore, no screen edge will be reserved if the layer surface has
some margins.

To address that, allow "floating" panels reserve screen edges and also
make kwin try harder to preserve window edges if the output layout
changes.

CCBUG: 448420
2024-01-29 11:14:15 +02:00
Vlad Zahorodnii
1eb95982dc autotests: Disable outline in breeze
Some our tests assume that with "none" border size, the decoration has
no borders. When breeze paints an outline, that's not the case.
2024-01-29 11:04:05 +02:00
Vlad Zahorodnii
b21229e59a wayland: Implement closeable window rule
BUG: 443129
2024-01-29 10:57:29 +02:00
Vlad Zahorodnii
1b6aa65ee5 autotests: Add layer_surface_v1.set_exclusive_edge test cases 2024-01-26 13:55:13 +02:00
Vlad Zahorodnii
9cdf19c657 autotests: Add keypad global shortcuts test 2024-01-24 13:20:58 +00:00
Aleix Pol
fd7a67d92e screencasting_test: Declaring the metatype is unnecessary now 2024-01-21 11:17:49 +00:00
Aleix Pol
0ce01ac30f screencasting: Fix CI
It seems on the CI the dataFrame is null at times
2024-01-19 14:05:51 +00:00
Aleix Pol
0b36919b7c screencasting_test: Adapt to KPipeWire change 2024-01-19 01:41:47 +01:00
Vlad Zahorodnii
da4f4d7e69 Rename UnmanagedLayer to OverlayLayer
The UnmanagedLayer layer is used for placing overlay content so
rename it to match how it's used in practice.
2024-01-18 13:13:55 +00:00
Vlad Zahorodnii
5c4acbdddd Introduce layer window rule
The new window rule allows to overwrite the stack layer. It can be
useful on wayland to force picture-in-picture surfaces (which are
xdg-toplevels at the moment) to be placed above fullscreen windows.
Keep above flag is unsuitable because fullscreen windows are placed
higher "above" windows.

CCBUG: 466016
2024-01-17 23:05:53 +00:00
Nate Graham
e963ae09cc screenedge: reduce default activation delay
Currently there is a 150ms delay before screen edge actions and
hotcorners are triggered; the cursor has to spend that much time there
before they'll activate. This is good for preventing accidental
activations, but also prevents and delays deliberate activations, which
are likely to be more annoying for the user.

To alleviate this, the delay is reduced to 75ms, which still prevents
most of the accidental activations in my testing, while making
deliberate activations faster and easier.
2024-01-17 14:52:05 +00:00
Jie Liu
1a1eaee13f Only precompute the geometry restore when m_interactiveMoveResize.initialQuickTileMode is None
If the user wants to move a tiled window but changes their mind and tiles the window back to the previous
position, quickTileGeometryRestore() will return an error value beacause m_electricMaximizing is true and
the m_electricGeometryRestore is the same as the geometry of the window in the last tiled mode.

Now the geometry restore of the tiled window is true when starting interactive move, so we no longer need
to precompute it.

Changes for testQuickTilingPointerMove:

We need to attach a new image after the tiling window, so that updateElectricGeometryRestore can obtain
the same framegeometry as the framegeometry obtained during actual runtime.

Now testQuickTilingPointerMove can detect the error:If the user wants to move a tiled window but changes
their mind and tiles the window back to the previous position, quickTileGeometryRestore() will return an
error value beacause m_electricMaximizing is true and the m_electricGeometryRestore is the same as the
geometry of the window in the last tiled mode.

Signed-off-by: Jie Liu <liujie01@kylinos.cn>
2024-01-17 01:03:27 +00:00
Vlad Zahorodnii
af39179446 Break show desktop mode if a new window is added
BUG: 479424
2024-01-15 15:41:57 +00:00
Vlad Zahorodnii
359f36d6ab autotests: Add a test to verify that show desktop mode quits after activating a window 2024-01-15 15:41:57 +00:00
Weng Xuetian
1fd5a6555e
inputmethod: Ensure InputPanelV1Window is always within the screen
Currently when input panel is using overlay mode and the cursor rectangle
is below or above the screen area, the input panel may be placed off the
screen. The change ensure it is always placed within the screen area
using similar math like xdg_popup's slide_y constrain.
2024-01-13 22:39:15 -08:00
Vlad Zahorodnii
66b1462cf8 xwayland: Make xinerama index -> Output mapping more robust with fractional scaling
xdg-output-v1 uses the fractional geometry, so also use it when mapping
a xinerama screen index to an Output.
2024-01-10 15:18:48 +00:00
Xaver Hugl
0ed66ed5d2 move more opengl related files to the opengl folder 2024-01-09 19:45:59 +01:00
Vlad Zahorodnii
6510fe6e5d scene: Fix SurfaceItem::bufferTransform()
The wayland spec is not quite clear about the transforms, but the buffer
transform indicates a transform from wl_surface to wl_buffer or compositor
global coordinate space to composited buffer.

On the other hand, SurfaceItem assumes that the order is vice versa.
2024-01-09 17:42:09 +00:00
Vlad Zahorodnii
c970d3261b core: Add OutputTransform::FlipY convenience aliases
`flip-y | rotate-N` transforms are equivalent to `flip-x | rotate-N`.
However, it is not intuitive to express transforms that flip the y axis
via flip-x transforms. This change adds convenience aliases to improve
code readability and keep code intuitive, which is going to be needed in
order to drop TextureTransforms flags.
2024-01-09 17:42:09 +00:00
Vlad Zahorodnii
9039612c20 core: Rename OutputTransform enums 2024-01-09 17:42:09 +00:00
Vlad Zahorodnii
47017d19de core: Make flip transform first
The wayland spec says we must flip first. FWIW it also matches how
kms processes reflect-x and reflect-y.
2024-01-09 17:42:09 +00:00
Vlad Zahorodnii
1905f7586e core: Change winding order of OutputTransform
Wayland spec says we must rotate counterclockwise.
2024-01-09 17:42:09 +00:00
Vlad Zahorodnii
e6853a9109 core: Add OutputTransform::map(QPointF,QPoint) 2024-01-09 17:42:09 +00:00
Vlad Zahorodnii
a9b01a68b8 core: Add OutputTransform::map(QRect,Size) overloads
These can be useful in case a QRect needs to be mapped. One could
convert the QRect into a QRectF and then back to QRect, but given that
these conversion helpers are present in rendering hot paths, it would
be great to be more efficient and also potentially loosing precision
because of floating point arithmetic.
2024-01-09 17:42:09 +00:00
Vlad Zahorodnii
98a1b5098a core: Add OutputTransform::toMatrix() 2024-01-09 17:42:09 +00:00
zhang yu
cbb95f5649 quit tile window when it is maxied in wayland env 2024-01-09 07:10:58 +00:00
Aleix Pol Gonzalez
df3e894c1a wayland: Install display.h
It's needed to properly access KWin::effects->waylandDisplay().

Signed-off-by: Georg Leugner <georg.leugner@mbition.io>
2024-01-08 23:06:43 +00:00
Xaver Hugl
6832aee3a2 autotests: add very basic ColorDescription mapping test 2023-12-22 20:25:44 +01:00
Stefan Hoffmeister
33beb28b5f autotests/drm: Fix connector_type_id usage 2023-12-22 18:39:21 +01:00
Vlad Zahorodnii
b3b43acc60 autotests: Slightly reduce line width in TestOutputTransform 2023-12-19 17:08:13 +02:00
Xaver Hugl
50346b6e37 core: Introduce OutputTransform::combine()
Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
2023-12-19 17:08:13 +02:00
Vlad Zahorodnii
71326cc91c autotests: Add OutputTransform test 2023-12-19 08:30:38 +00:00
Vlad Zahorodnii
d733daf772 Drop dead code 2023-12-15 08:57:11 +00:00
Vlad Zahorodnii
dd9e04fb18 Fix -Wdeprecated-declarations 2023-12-01 12:06:48 +02:00
Bharadwaj Raju
e5753ea336 Make autohide screen edges use the same activation delay setting as other edges
Makes it possible to easily target things in a window near your panel edge,
without bringing up your panel.

The `m_client` condition this MR removes appears to have been added solely to make autohiding panels appear instantly. See c4140d6f4e.

BUG: 267277
2023-12-01 08:09:35 +00:00
Vlad Zahorodnii
784d48ef52 Port away from deprecated KConfigBase::group() api 2023-11-28 10:02:03 +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
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
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
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
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