Commit graph

143 commits

Author SHA1 Message Date
Xaver Hugl
e16069ae77 autotests: add Xwayland scale changes to the output changes test
CCBUG: 487409
2024-06-17 20:41:58 +02:00
Vlad Zahorodnii
31f80d18f2 wayland: Use xdg-dialog-v1 basename 2024-04-26 11:31:34 +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
Aleix Pol
ac9b9a6772 buttonrebinds: Introduce tests
Should help make sure the rebind feature stays working.
2024-03-14 14:39:00 -07:00
David Edmundson
b650f55d60 xwayland: Add unit test for XWayland key tracking 2024-03-03 12:41:15 +00:00
Aleix Pol Gonzalez
bf1ce85474 Make it possible to build KWin without libxcb
Now that we have Wayland around, there's a whole branch of dependencies
that shouldn't be necessary anymore.
This allows to build KWin without all of it, allowing us to have a much
more compact alignment for cases where all the legacy software isn't
necessary anymore.

Bundle KWindowSystem X11-specific headers into it too, since it's part
of the same process.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-02-28 16:03:50 +00: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
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
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
Nicolas Fella
d4127d07fd Implement locking sticky keys on Wayland
When pressing a latched modifier a second time lock it

When pressing a locked modifier release it

BUG: 464452
2023-11-23 08:17:00 +00:00
David Edmundson
4f9531ad77 Support SecurityContextManagerV1
This allows KWin to securely identify the client for a given connection,
without relying on the process name.

This patch does not do anything meaningful with the application ID other
than store it.

This first version does not support kwin restarts, it can come
afterwards.

Testing done:
With latest flatpak, running `WAYLAND_DEBUG=1 flatpak run org.telegram.desktop |& grep security`
shows that flatpak itself bound the security context, and the client did not see it advertised.
2023-11-13 09:51:28 +00:00
David Edmundson
c711997d31 Revert "Temporarily disable testXkb and testX11Window"
This reverts commit 6bad553f05
2023-11-06 09:52:31 +00:00
Vlad Zahorodnii
0f5e719b61 wayland: Fix none keyboard interactivity in LayerShellV1Window
Window::acceptsFocus() is not taken into account when a window is
activated using Workspace::activateWindow(). The main reason is because
of different input models on X11.

Instead, Window::takeFocus() should check itself if the window accepts
focus.
2023-11-06 08:07:32 +00:00
Arjen Hiemstra
6bad553f05 Temporarily disable testXkb and testX11Window
These prevent merging
2023-10-31 20:35:26 +00:00
Vlad Zahorodnii
3bed991941 Link KI18n with libkwin privately 2023-10-25 12:46:12 +00:00
Vlad Zahorodnii
d6e94163f5 backends/fakeinput: Implement fake input protocol in backend
The interface is redundant now since there's an abstract input backend
abstraction.
2023-09-22 11:08:26 +03:00
Alexander Lohnau
40be656eed Adjust to changed signature of kcoreaddons_target_static_plugins
Depends on https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/360
2023-08-27 12:09:56 +02:00
Vlad Zahorodnii
6cd56d5192 wayland: Implement cursor-shape-v1
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/194
2023-07-12 11:22:11 +03:00
Aleix Pol Gonzalez
49a76ea772 Install KWaylandServer headers
There are use cases for the headers to be used, e.g. when implementing
wayland-specific workflows from an Effect.
In order to be able to use these, we also need to expose libkwin to be
imported as it carries the interfaces' symbols.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2023-07-04 08:22:43 +00:00
Vlad Zahorodnii
16cc0f5ebb autotests: Make test framework a static lib again
Static plugins being linked with shared libraries doesn't work smoothly.
POSITION_INDEPENDENT_CODE target property needs to be set for
every such plugin. However, there can be targets that we have no control
over, which need POSITION_INDEPENDENT_CODE to be set too. Asking such
projects to add this property and them refusing to do so would be
reasonable because kwin's entire static plugin pipeline is weird.

The test framework was made a shared library because kwin build
directory used to get really big (in 10s of gigabytes).

Due to the -fPIC issues, this change makes the test framework a static
lib again. Obviously, this brings back the big build directory problem.
But, it's not as terrible as it used to be. With this change, kwin build
directory is a couple of gigabytes in debug build, which is a lot but
not as bad as it used to be before.
2023-06-23 08:01:03 +00:00
Vlad Zahorodnii
84c7d3cf4b autotests: Remove cursor.cpp from test framework sources
It's included because of InputConfig, but we don't need to include
cursor.cpp for this purpose.
2023-06-21 10:48:50 +00:00
Vlad Zahorodnii
83261fc82a wayland: Implement kde-screen-edge-v1
It's needed to port the plasma panel to the layer shell protocol.
2023-05-19 13:36:38 +00:00
Vlad Zahorodnii
1d1ccc3770 autotests: Rework _KDE_NET_WM_SCREEN_EDGE_SHOW test 2023-05-09 08:16:53 +00:00
Vlad Zahorodnii
0a82f33db5 Drop XCB_ICCCM_FOUND checks
Qt requires xcb-icccm 0.3.9. On the other hand, 0.3.9 contains all the
types and functions used by kwin, so remove the corresponding
XCB_ICCM_FOUND checks to simplify the code.
2023-05-03 11:40:01 +00:00
Vlad Zahorodnii
5a42d0ac0e autotests: Drop testDontCrashNoBorder
The test used to verify that kwin doesn't crash when ShellClient sets
new geometry. ShellClient used to access decoration borders without
checking whether decoration() is null.

On the other hand, we've added a bunch of new test cases in
testXdgShellWindow, so let's remove this one. If the bug is back, that
test will fail.
2023-04-24 10:13:58 +00:00
Vlad Zahorodnii
959bb661af autotests: Drop testBufferSizeChange
testXdgShellWindow already tests intricate subsurface size changes. The
surface pixmaps are handled differently now too, so the test is not
useful as it used to be 4 or 5 years ago.
2023-04-22 15:03:19 +00:00
Vlad Zahorodnii
ee31581006 autotests: Remove WAYLAND_ONLY tests
WAYLAND_ONLY will create two tests: one with Xwayland, the other without
Xwayland. This is somewhat wasteful and it results in higher CI times.

On the other hand, Xwayland is started on demand. If a test doesn't need
Xwayland, it won't start.

So let's remove WAYLAND_ONLY in order to lighten kwin on CI resources.
If wayland only tests are needed, we can consider passing the operation
mode to the WAYLANDTEST_MAIN helper, but there aren't such tests afaik.
2023-04-21 14:25:23 +03:00
Aleix Pol
d0b87a900f screencasting: Add an autotest
Adds an autotest that makes sure a screencasting stream works as
expected.
Adds an optional dependency to KPipeWire only effective to run the test.
2023-03-31 00:19:59 +02:00
Vlad Zahorodnii
06d195980b autotests: Drop night color test
It doesn't test anything useful. It's hard to make it test useful things
too due to needing to change the system time. Linking with it also
breaks the encapsulation and it won't work when using MODULE library.
2023-03-01 15:50:10 +00:00
Vlad Zahorodnii
10df3b0eb0 Remove Qt 5 specific code 2023-02-28 18:30:26 +02:00
Vlad Zahorodnii
d9f5d432be Port to KF6 2023-02-28 18:30:26 +02:00
David Edmundson
c4b134da8d Implement wp-fractional-scale-v1
This allows clients to provide buffers at native resolutions when
fractional scaling is used.

Virtual backend is adjusted to support scales as floats
2022-12-12 12:16:18 +00:00
Marco Martin
e4507861f7 Custom quick tiling with configuration ui
* Allow to do quick tiling to custom tile geometries, windows will be snapped to tiles when dragged with the shift modifier pressed.
* Tile geometries are screen specific.
* The global shortcut Meta+T will trigger a fullscreen configuration ui as a QML effect for the tiles which allows to add, remove and resize tiles
* UI and behavior is a bit similar to the Windows Fancy Zones addon: https://docs.microsoft.com/en-us/windows/powertoys/fancyzones
* Its main scope is to help the workflow with very big monitors, especially ultra wide ones, where most application don't make sense maximized to the full screen (eventually also support games to be full screened to a given tile instead of the whole screen)
* it should get also some bindings for scripting, as its ain goal is not to replicate other popular tiling window managers, but should give the popular kwin tiling scripts to have a more robust infrastructure
* it will eventually get support for a set of predefined layouts, but this is for a second phase

BUG: 438788
2022-12-01 14:39:22 +00:00
Vlad Zahorodnii
6b253074f3 autotests: Drop testSceneQPainter
The entire approach behind that test is wrong. Even slight changes in
one pixel can make the test fail. There's no human-friendly way to
determine what the difference between reference and actual frames are.
The reference frame is generated in code rather than from an image on
the disk, which makes the tests even more error-prone.

The test is flaky too and constantly blocks merging patch submissions.

We need a different way to test rendering results, not what
testSceneQPainter currently does. Normally, I would say that we need
to add such an infrastructure before dropping the test, but it makes the
merging process so inconvenient and the test doesn't really bring any
value, it tests really basic cases which are noticeable right away after
launching kwin.
2022-10-26 14:08:38 +00:00
Vlad Zahorodnii
de3aa69c1e Fix some tests not building with Qt 6
Client-side wrappers for input-method-unstable-v1 fail to build because
wl_keyboard_interface is referenced in the header file generated by
wayland-scanner.

Unfortunately, qt6_generate_wayland_protocol_client_sources() forces
--include-core-only argument, this is addressed in Qt 6.4.1, but in
meanwhile let's ship a copy of Qt6WaylandClientMacros.cmake file until
the required Qt version is out.
2022-10-20 09:37:00 +00:00
Vlad Zahorodnii
7734676aa1 autotests: Drop DontCrashCursorPhysicalSizeEmpty
wl_cursor is no longer used to load cursors on server side so the test
is irrelevant now.
2022-10-20 06:18:30 +00:00
Vlad Zahorodnii
c519f2d126 autotests: Port KWinFrameworkIntegration from source vars to target based apis 2022-04-25 13:12:21 +00:00
Vlad Zahorodnii
4b91c6163f Rename XdgShellClient to XdgShellWindow
The word "client" means different things in wayland and kwin. Use a
better word to refer to windows.
2022-04-23 07:55:51 +00:00
Vlad Zahorodnii
a21aa839b1 Rename X11Client to X11Window
The word "client" means different things in wayland and kwin. Use a
better word to refer to windows.
2022-04-23 07:55:51 +00:00
Vlad Zahorodnii
3cdee2f24a Rename LayerShellV1Client to LayerShellV1Window
The word "client" means different things in wayland and kwin. Use a
better word to refer to windows.
2022-04-23 07:55:51 +00:00
Xaver Hugl
f6eee463ba Make lcms2 a hard dependency
When we do more color management stuff we'll need it in more places,
making it a hard requirement reduces the amount of needed ifdefs and
should make adding color management features a little simpler.
2022-04-20 12:21:38 +02:00
Volker Krause
2a171e5fa8 Adapt build system to also support building against Qt6 2022-03-25 08:26:49 +00:00
Julius Zint
39160e7dbd Remove no_xdg_runtime_dir_test
[6/6] Make autotests create fake input devices

This test was the only one where input() could return a nullptr. With
this test removed, autotests can now expect input() to always return a
sane valid value and are therefor simpler to write.

That test belongs in kwayland-server anyway and kwayland-server's test
suite already tests that starting without XDG_RUNTIME_DIR is a no-no
thing
2022-03-17 08:35:40 +00:00
Kai Uwe Broulik
a55ea639a1 autotests: Guard tabbox_test by KWIN_BUILD_TABBOX
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-03-03 14:34:10 +00:00
Kai Uwe Broulik
d54723cbf2 Add KWIN_BUILD_SCREENLOCKER option
Allows to build KWin without lockscreen support and thus drops the
kscreenlocker dependency.

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-23 14:39:25 +01:00
Vlad Zahorodnii
6a0430eaa0 Fix builtin effects not loading
The api of kcoreaddons_target_static_plugins() has changed so static
plugins must be linked with kwin_x11 and kwin_wayland directly.
2022-02-06 01:29:41 +02:00