128 Commits (7aaf2d290379cddf5dd1ece3f7614476eb82641a)

Author SHA1 Message Date
David Edmundson c711997d31 Revert "Temporarily disable testXkb and testX11Window"
This reverts commit 6bad553f05
11 months ago
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.
11 months ago
Arjen Hiemstra 6bad553f05 Temporarily disable testXkb and testX11Window
These prevent merging
11 months ago
Vlad Zahorodnii 3bed991941 Link KI18n with libkwin privately 11 months ago
Vlad Zahorodnii d6e94163f5 backends/fakeinput: Implement fake input protocol in backend
The interface is redundant now since there's an abstract input backend
abstraction.
1 year ago
Alexander Lohnau 40be656eed Adjust to changed signature of kcoreaddons_target_static_plugins
Depends on https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/360
1 year ago
Vlad Zahorodnii 6cd56d5192 wayland: Implement cursor-shape-v1
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/194
1 year ago
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>
1 year ago
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.
1 year ago
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.
1 year ago
Vlad Zahorodnii 83261fc82a wayland: Implement kde-screen-edge-v1
It's needed to port the plasma panel to the layer shell protocol.
1 year ago
Vlad Zahorodnii 1d1ccc3770 autotests: Rework _KDE_NET_WM_SCREEN_EDGE_SHOW test 1 year ago
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.
1 year ago
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.
1 year ago
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.
1 year ago
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.
1 year ago
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.
1 year ago
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.
2 years ago
Vlad Zahorodnii 10df3b0eb0 Remove Qt 5 specific code 2 years ago
Vlad Zahorodnii d9f5d432be Port to KF6 2 years ago
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
2 years ago
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
2 years ago
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.
2 years ago
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.
2 years ago
Vlad Zahorodnii 7734676aa1 autotests: Drop DontCrashCursorPhysicalSizeEmpty
wl_cursor is no longer used to load cursors on server side so the test
is irrelevant now.
2 years ago
Vlad Zahorodnii c519f2d126 autotests: Port KWinFrameworkIntegration from source vars to target based apis 2 years ago
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.
2 years ago
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.
2 years ago
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.
2 years ago
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.
2 years ago
Volker Krause 2a171e5fa8 Adapt build system to also support building against Qt6 3 years ago
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
3 years ago
Kai Uwe Broulik a55ea639a1 autotests: Guard tabbox_test by KWIN_BUILD_TABBOX
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
3 years ago
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>
3 years ago
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.
3 years ago
Vlad Zahorodnii acea685b04 autotests: Replace output management test with a more useful test
The output management test checks the implementation of output
management capabilities in the virtual backend, which is not helpful.

This change replaces it with a more useful test that verifies how
windows are placed after an output change.
3 years ago
Arjen Hiemstra e5ca5df0c5 autotests: Use a shared library for the integration test framework
Ever since the effects were changed to static, each test of the
integration tests includes all the effects. The result of this is that
when doing a debug build each test is now 60MiB or more. With the amount
of tests, this results in ~8 GiB of diskspace used just for KWin's
binary output directory, which is rather excessive.

Since the tests all share a common framework library, we can change that
library to a shared library and that way avoid linking all the effects
into each test.

Most of this is shuffling around some link libraries in the integration
test CMakeLists, however, I needed to export the Xwayland class as it is
used by one of the tests but wasn't exported.
3 years ago
Vlad Zahorodnii 141947d2e8 effects: Link builtin effects with executables
The main motivation behind this change is to prepare kwin for importing
kwayland-server code in libkwin.

As is, builtin effects are linked with libkwin. Some builtin effects
have wayland specific code. If we move wayland stuff in libkwin, there's
going to be a circular dependency between kwin4_effect_builtins and
libkwin targets.

This change intends to break that dependency by linking builtin effects
to kwin executable.

The main issue with that is that EffectLoader would need to discover the
effects indirectly. QStaticPlugin is used for that purpose.

Besides breaking the cyclic dependency, it makes builtin effects use the
same plugin infrastructure in libkwineffects that external effects use.

Metadata in src/effects/effect_builtins.cpp was converted in a list of
python dictionaries, which was fed to a python script that generated
main.cpp and metadata.json files.
3 years ago
Vlad Zahorodnii 5be593d4e4 wayland: Drop internal connection
It's practically unused now.
3 years ago
Méven Car 2eb5da1d6f Port autotests/integration/outputmanagement_test to kde_output_management_v2 3 years ago
Vlad Zahorodnii 901e479482 autotests: Rewrite testScreenEdges as an integration test
Due to the screen edges test not being an integration test, it's very
hard to change output related code in libkwin. screens.cpp needs to have
a few ifdefs to successfully compile.

This change rewrites the screen edges test as an integration test in
order to allow us using other components of kwin in screens.cpp and
screenedge.cpp without ifdef guards.

It's not a one-to-one port.
3 years ago
Vlad Zahorodnii 43106b7e5d autotests: Remove SceneOpenGLShadowTest
It's barely readable and it doesn't add any real value.
3 years ago
Vlad Zahorodnii de122825fd scenes/qpainter: Remove support for drop-shadows
Drop-shadows with the software render backend impact performance quite
significantly. It also makes it easier to prepare render backends for the
item based design.
3 years ago
Nicolas Fella f910b0de97 Use version-less qt DBus macros
They work with both Qt5 and Qt6
3 years ago
Vlad Zahorodnii b6dd7c5860 autotests: Introduce own idle inhibit v1 helpers
Non-core wrappers in kwayland are deprecated. qtwaylandscanner needs to
be used instead for generating client-side wrappers.
3 years ago
Vlad Zahorodnii 282e0d1c4d autotests: Port the tests to new xdg-shell helpers 3 years ago
Aleix Pol 4638f2f309 inputmethod: Refactor VirtualKeyboardDBus to have its own InputMethpd
This way we can have it call methods directly instead of connecting to
its signals.
4 years ago
Vlad Zahorodnii 93e0265e4e Move source code to src/ directory
Once in a while, we receive complaints from other fellow KDE developers
about the file organization of kwin. This change addresses some of those
complaints by moving all of source code in a separate directory, src/,
thus making the project structure more traditional. Things such as tests
are kept in their own toplevel directories.

This change may wreak havoc on merge requests that add new files to kwin,
but if a patch modifies an already existing file, git should be smart
enough to figure out that the file has been relocated.

We may potentially split the src/ directory further to make navigating
the source code easier, but hopefully this is good enough already.
4 years ago
Nicolas Fella 99947c8bd8 Use versionless Qt cmake target
This makes it easier to build against both Qt5 and Qt6

GIT_SILENT
4 years ago
Méven Car 4f744d1bb6 Add TestOutputManagement::testOutputDeviceDisabled test
Allow VirtualBackend to supports Output changes.
4 years ago