Commit graph

1795 commits

Author SHA1 Message Date
Xaver Hugl
92ceb00b37 autotests/drm: add test for vrr capability changing without a hotunplug 2024-06-24 18:47:00 +02:00
Vlad Zahorodnii
944be3d55a Drop WaylandServer initialization flags
These flags affect kwin in general so WaylandServer is not the best place
for them to live in. For such things, we typically add properties in the
Application object, which is what this change does.
2024-06-23 17:53:17 +00:00
Xaver Hugl
e16069ae77 autotests: add Xwayland scale changes to the output changes test
CCBUG: 487409
2024-06-17 20:41:58 +02:00
Marius P
ba599a2aa0 Prefer en_US, "centre" -> "center" 2024-06-17 05:29:59 +00:00
Vlad Zahorodnii
4db2742e96 autotests: Add a missing mock definition of Xcb::toXNative(QRectF) 2024-06-13 08:34:30 +00:00
Xaver Hugl
bffae41983 remove Workspace::sendWindowToOutput
It just calls Window::sendToOutput...

BUG: 329980
2024-06-07 00:44:24 +00:00
Xaver Hugl
47d873db94 autotests/drm: disable testModeset
It only works with the assumption that outputs are enabled by default, which
is not the case anymore
2024-06-05 13:12:56 +00:00
Vlad Zahorodnii
d048f9aad8 autotests: Destroy WaylandServer before Application 2024-06-03 11:22:13 +00:00
David Redondo
ba7b23c41d autotests/test_xkb: Do not expect fail in fixed Qt versions 2024-05-29 12:12:42 +02:00
Yifan Zhu
09d4f3fda3 xkb: support converting Qt keys to keysyms
QXkbCommon::toKeysym doesn't correctly handle the case where a single Qt
key map to multiple keysyms.

BUG: 482847
2024-05-27 18:27:33 +00:00
David Edmundson
73425b13a4 autotests: Improve autotests for window scaling 2024-05-24 18:23:05 +00:00
Xaver Hugl
df9b0bd8f0 backends: move output refresh duration to compositor 2024-05-24 17:32:20 +02:00
Niccolò Venerandi
b59ba5b9b7 Do not snap to windows of the Dock type
We do not snap to docks (i.e. panels) since the ones we
actually want to snap to (i.e. always visible ones) will
restrict the workspace area, and the window will snap to
that, effectively snapping to the panel too. Explicitedly
avoiding panel snapping solves any possible issue of
floating panels, since they change their size when a window
gets near them.
2024-05-17 09:17:24 +00:00
Xaver Hugl
33fe211471 placementtracker: fix restoring of windows in custom tiles
There were two problems preventing it from working:
1. The placement tracker didn't handle them correctly; now it sets the custom tile mode
after moving the window to its location
2. The window code used `output()` instead of `moveResizeOutput()`, which means when KWin
just moved the window to a different screen and immediately changes the tile mode
afterwards, it would tile the window on the wrong output
2024-05-03 16:47:47 +02:00
Xaver Hugl
14c08422ca placementtracker: fix quick tiled windows not being restored correctly
There were two problems:
1. Workspace interacted with the tile mode of windows before inhibiting
the placement tracker, so the wrong window state was stored in the placement
tracker
2. Window::setQuickTileMode is unintuitive and has some undesired side effects,
meant to handle quick tiling with keyboard shortcuts and by dragging the
window with a mouse specifically. This commit just works around that by
un-setting the tile mode first

BUG: 461886
2024-05-03 15:58:17 +02:00
Xaver Hugl
df9f8f8346 fix vertically maximized windows sometimes being moved out of the screen
...and add a test for it

BUG: 476037
2024-05-03 13:45:18 +00:00
Xaver Hugl
fb28d75ad8 placementtracker: fix vertically maximized windows being misplaced
...and extend the autotest to cover that situation.

CCBUG: 476037
2024-05-03 13:45:18 +00:00
Xaver Hugl
219f110093 backends: move render time queries into OutputFrame
This way, multiple OutputFrames can be pending at the same time, without
interfering in each other's render time queries
2024-05-02 13:03:27 +00:00
Xaver Hugl
93d810aaad backends/drm: unify primary and cursor plane layers
Drm planes aren't specialized enough to need completely separate code paths to
handle them, and having one class for all layers makes it easier to add support
for overlay planes
2024-04-30 13:43:36 +00:00
Xaver Hugl
e4e5c52300 autotests/integration: clean up remnants of "active output follows mouse" setting in screenstest 2024-04-29 14:13:32 +00:00
Xaver Hugl
55e5d50074 autotests/integration: fix xdg shell test
It made now-invalid assumptions about how the active output is decided
2024-04-29 14:13:32 +00:00
Xaver Hugl
77cf49aa72 backends: refactor direct scanout and dmabuf feedback
This moves some of the responsbilities up in the stack, which simplifies
the backends and opens up some future possibilities like making direct scanout
work for non-surface items
2024-04-27 18:39:23 +00:00
Vlad Zahorodnii
31f80d18f2 wayland: Use xdg-dialog-v1 basename 2024-04-26 11:31:34 +00:00
Vlad Zahorodnii
69b8c91655 Drop more (unnecessary) geometry updates blockers 2024-04-26 08:01:21 +00:00
Vlad Zahorodnii
1470cfc790 Drop Window::keepInArea() overload with hidden moveResize()
Hidden moveResize() calls stand in the way of making geometry code
reusable or more refactorable. They also usually require one using
geometry update blockers, which are just a horrible concept because
they make geometry code unnecessarily more complex and add more failure
points.
2024-04-24 14:19:42 +00:00
Marco Martin
52b92904de Quick tiling double buffereing
The quicktileMode member now is just for the requested tile mode, base the "real" mode only on m_tile.

The requested tile mode is used for double buffering, to look and behave just like requestedMAximizeMode() which is updated immediately, but needs to acknowledge the configure request and render for quickTileMode() (and the right tile() instanced to be associated) to be updated accordingly
2024-04-15 12:18:09 +00:00
Yifan Zhu
9ca69cf50c screenedge: reset timer when pointer leaves edge
Currently the edge erroneously triggers when the pointer repeatedly
enters and leaves the edge in short durations. Send all events to edges,
and reset the timer when pointer leaves edge. Add corresponding test.

BUG: 441892
FIXED-IN: 6.0.4
2024-04-10 20:55:29 +00:00
Yifan Zhu
c05a26f5c4 remove modifier only shortcuts
This is now implemented in kglobalacceld

BUG: 371560
2024-04-05 07:35:58 -07:00
David Redondo
9a74d70ba4 Fix build with newer QtWaylandScanner
Because of a shortcoming in upstream qtwaylandscanner and the cmake
macro we defered to the ecm macro which renames the output files
acoording to what qtwaylandscanner expects. However since this
was corrected in newer Qt this doesn't build anymore since
the tool now expects correctly named files.
2024-04-04 16:08:58 +00:00
David Redondo
cbab4b46c1 Implement xdg-dialog-v1 2024-04-03 14:34:53 +00:00
Xaver Hugl
d0b69f3503 backends/drm: use DrmDevice 2024-03-22 12:07:29 +01:00
Vlad Zahorodnii
442648edc0 wayland: Remove zombie ClientConnection from Display later
Otherwise it's theoretically possible to create a new ClientConnection
object for the zombie wl_client when its resources are being destroyed.
For example

- process early wl_client destroy notification
- the ClientConnection objects gets removed from the client list in Display
- process wl_resource objects getting destroyed
- if some code calls display->getConnection(zombie_client), it's going to
  reintroduce the client in the client list
- process late wl_client destroy notification, it's going to destroy the
  original and the clone ClientConnection object

This change prevents reintoducing a clone client object, by keeping the
original for a bit longer until it's actually destroyed. In the future though,
it would be great to kill the client lists in Display and ClientConnection,
and just use `static_cast<ClientConnection *>(wl_client_get_user_data())`.
2024-03-20 13:41:59 +00:00
Vlad Zahorodnii
6412fd2c34 autotests: Add WM_TRANSIENT_FOR tests 2024-03-20 08:12:54 +00:00
Xaver Hugl
630ba5fab4 pointer input: handle warp events differently from absolute motion events
As Wayland doesn't have a warp event yet, before this commit, warps were
dealt with like normal absolute motion events. This trips up games though,
which don't deal with actual absolute motion events well. As a solution
to that, until an actual warp event is a thing, we send a motion event with
a position + a relative motion event with no motion

BUG: 458233
CCBUG: 482476
2024-03-19 20:13:11 +01:00
Kristen McWilliam
246824aa61 autotests: add test for global keyboard shortcut
Adds an integration test that verifies the screen locks when the global keyboard shortcut is invoked.
2024-03-19 18:00:12 +00:00
Vlad Zahorodnii
fb6ce3707a autotests: Add _NET_WM_STATE_MODAL tests 2024-03-19 12:47:59 +00:00
Vlad Zahorodnii
6b1e2f24f4 autotests: Add _NET_WM_MOVERESIZE tests 2024-03-18 20:54:10 +00:00
Vlad Zahorodnii
8892b16626 autotests: Add tests to check unmaximizing X11Window by dragging it 2024-03-18 18:23:33 +00:00
Vlad Zahorodnii
22ef6d9ddf autotests: Stabilize X11WindowTest
Make a roundtrip to the x server to ensure that WM_STATE changes have
been propagated. xcb_flush() is not good enough, there's still a race
condition between the wm flushing its connection and the client reading
window properties.
2024-03-18 08:46:11 +00:00
Vlad Zahorodnii
f563bade46 autotests: Add desktop tests in X11WindowTest 2024-03-16 10:25:32 +00:00
Harald Sitter
645db7fc90 keyboard_layout: always expose dbus interface
our plasmoid only listens to signals when the interface was found.
also when switching from 2 to 1 layout we'd emit a signal that the
layouts changed but then we'd throw away our interface leaving
the client wondering what happened to us (and consequently
printing warnings because our service wasn't found)

this specifically resulted in the plasmoid not getting layout event
changes when switching from 1 to >1

BUG: 449531
2024-03-15 22:21:08 +00:00
Vlad Zahorodnii
7db47ac2fd autotests: Add a test case for _NET_WM_WINDOW_OPACITY 2024-03-15 21:23:31 +02:00
Vlad Zahorodnii
11a5513e78 Avoid moving the window while it's maximized
Unlike X11, on Wayland, the window won't change its maximize mode until
it renders a new buffer. This creates a problem for interactive move
because if it's not careful and moves the window while it's still effectively
maximized, it will look as if the window has leaked to other screens.

This change fixes the problem by making Window::handleInteractiveMoveResize()
avoid move() if the window needs to be unmaximized.

As a bonus, it also allows to unmaximize the windows that are maximized
along only one dimension by dragging them.

Unfortunately, tiling stuff still suffers from the same issue. In order
to fix it, Window::tile() has to be part of double buffered state, like
Window::maximizeMode().

BUG: 449105
BUG: 459218
CCBUG: 482085
2024-03-15 18:00:52 +00:00
Vlad Zahorodnii
2d5a69b1d2 autotests: Add skip switcher/pager/taskbar tests in X11WindowTest 2024-03-15 17:16:27 +00:00
Aleix Pol
ac9b9a6772 buttonrebinds: Introduce tests
Should help make sure the rebind feature stays working.
2024-03-14 14:39:00 -07:00
Vlad Zahorodnii
0b4c6f8b3b autotests: Reduce amount of boilerplate code in X11 window test 2024-03-14 21:27:05 +00:00
Vlad Zahorodnii
acb4945cd3 autotests: Add more basic X11 window tests 2024-03-14 18:36:41 +00:00
Yifan Zhu
681752ada1 xkb: fix testing if on keypad
XKB_KEY_KP_9 is 0xffb9 while XKB_KEY_KP_Equal is 0xffbd and XKB_KEY_F1
is 0xffbe. So XKB_KEY_KP_Equal, instead of XKB_KEY_KP_9, has the maximum
keysym for keypad keys.
2024-03-11 07:47:58 -07:00
David Edmundson
9302e84b95 wayland: Revert send pointer leave on drag
This was changed to match the behaviour of other compositors.
However what kwin did before is more sensible.

Sending a leave event breaks cursor updates by design. See
https://gitlab.freedesktop.org/wayland/wayland/-/issues/444
2024-03-11 11:32:35 +00:00
Vlad Zahorodnii
4d659998d4 autotests: Make cursor-shape-device-v1 factory function return a std::unique_ptr 2024-03-11 08:52:10 +00:00