1597 Commits (5eec4cdb52d0663e1f23e5c9dd16cf99791a6fc9)

Author SHA1 Message Date
Laurent Montel b823747c3b Add explicit moc includes to sources for moc-covered headers
* speeds up incremental builds as changes to a header will not always
  need the full mocs_compilation.cpp for all the target's headers rebuild,
  while having a moc file sourced into a source file only adds minor
  extra costs, due to small own code and the used headers usually
  already covered by the source file, being for the same class/struct
* seems to not slow down clean builds, due to empty mocs_compilation.cpp
  resulting in those quickly processed, while the minor extra cost of the
  sourced moc files does not outweigh that in summary.
  Measured times actually improved by some percent points.
  (ideally CMake would just skip empty mocs_compilation.cpp & its object
  file one day)
* enables compiler to see all methods of a class in same compilation unit
  to do some sanity checks
* potentially more inlining in general, due to more in the compilation unit
* allows to keep using more forward declarations in the header, as with the
  moc code being sourced into the cpp file there definitions can be ensured
  and often are already for the needs of the normal class methods
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
Laurent Montel 86c6238cfa Don't use QtTest => use QTest + missing include 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 88ade3a409 Extract reusable egl swapchain bits
EGL rendering has some duplicated bits, so this change extracts
them to reduce code duplication.
1 year ago
Vlad Zahorodnii 3bd5e91226 Extract reusable qpainter swapchain bits
QPainter rendering has some duplicated bits, so this change extracts
them to reduce code duplication.
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 3698127bc6 Drop InputConfig
The InputConfig was introduced to handle tests that don't have valid
kwinApp object. Those tests have been either reworked or dropped, so
let's drop the InputConfig to tidy the config stuff.
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
Xaver Hugl 480f857d29 outputconfigurationstore: don't handle laptop lid closing yet
Interactions with KScreen cause settings to be reset to the default when the lid
gets closed, so handling lid closing in KWin needs to wait until KScreen no longer
writes configs

BUG: 471282
1 year ago
Vlad Zahorodnii d6a384627b autotests: Let drm test use host primary node to allocate buffers 1 year ago
Vlad Zahorodnii 082301920e backends/drm: Port to GraphicsBuffer
This change ports the drm backend to the GraphicsBuffer and
GraphicsBufferAllocator.

The main motivation is to unify graphics buffer abstractions across
various backends and to prepare it for output layers, which could be
nicer if we could have direct control over the buffers.
1 year ago
Vlad Zahorodnii 712fd3396c Sync EffectsHandler::windowAdded with Workspace::windowAdded
This change makes the EffectsHandler emit the windowAdded signal as soon
as the Workspace::windowAdded signal is received and minimize the
difference between the states observed in kwin core and effects.
1 year ago
Vlad Zahorodnii 23f533aa52 autotests: Skip ScreencastingTest::testOutputCasting when running in ci
The test is flaky. We work around it by passing --repeat until-pass, but
lately even it doesn't help us with this issue.

So skip the test when running it inside KDE CI for a few months until
it gets a newer kernel.
1 year ago
Aleix Pol fbbaab3eaf kcm/decoration: Allow specifying the kcm separately from the decoration
It makes decorations lighter as they don't need to bundle its
configuration logic.
Deprecates the kcmodule property in favour of kcmoduleName which instead
of assuming that the kcm is local to the plugin, it provides the plugin
name to find and load.
1 year ago
Vlad Zahorodnii b90ae2f8fc Move window hiding logic to Window
The window hiding logic is mostly the same both in X11 and Wayland
windows, so let's move it in Window to share the same code.
1 year ago
David Edmundson 3ea701743e screen edge: Emit cleanup signals if needed on teardown
The Effects API has one signal screenEdgeApproaching with effects
monitoring the last signal to stay in sync.

If an Edge is destroyed whilst visible, effects currently do not get
notified and it can stay there forever.

This patch emits screenEdgeApproaching if appropriate with a factor of 0
when an edge is destroyed.

BUG: 403354
1 year ago
Vlad Zahorodnii ebf6bd3a33 autotests: Move plasmashell bits from testMoveResizeWindow to testPlasmaSurface
Move the plasmashell specific bits to testPlasmaSurface so it's all
encapsulated and easy to drop in the future.
1 year ago
Vlad Zahorodnii 1c87a804f0 autotests: Port testShowingDesktop to layer-shell 1 year ago
Vlad Zahorodnii 05695d7f1b autotests: Avoid binding plasmashell global in tests that don't use it 1 year ago
Vlad Zahorodnii 2aba3deca4 wayland: Drop screen edge support in XdgToplevelWindow
Use kde_screen_edge_v1 + layer surface instead.
1 year ago
Vlad Zahorodnii cdb8887a15 wayland: Drop strut support in XdgToplevelWindow
Use layer_surface.set_exclusive_zone instead.
1 year ago
Vlad Zahorodnii 9d0bb1bff7 autotests: Remove incorrect test
StrutsTest::testLeftScreenSmallerBottomAligned() used to pass because
one of the previous tests changes the maximize policy to maximize.

A window will be maximized only if it's larger than the maximize area
but smaller than the screen area. That's not the case and the test makes
an incorrect assumption about how X11Windows are placed.
1 year ago
Vlad Zahorodnii 6b2f46ca1f autotests: Remove unused outputbackend.h includes 1 year ago
Vlad Zahorodnii cab0765947 autotests: Use layer-shell based panels 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
Ismael Asensio 2449b58974 tiles: Adjust padding between windows
Make the total padding between windows equal to the padding against the
screen borders by applying just half of it on the common borders.

Adjust tests accordingly.

BUG: 469720
FIXED-IN: 5.27.6
1 year ago
Aleix Pol d6b07b313f libkwineffects: Stop including xcb/xcb.h everywhere
Provide a kwinxcb.h header file instead that offers the xcb-specific bits
from that API. It helps keep kwin effects disconnected from XCB.
1 year ago
Vlad Zahorodnii 223b01f9e7 wayland: Reevaluate layer shell window layer
Currently, if the layer shell surface's layer changes, the Window's
layer is not synchronized with it.
1 year ago
Xaver Hugl 8229573e63 autotests/drm: add a test for doing modesets
And fix an issue preventing it from working
1 year ago
Vlad Zahorodnii dbce106031 wayland: Grab the contents of cursor scene 1 year ago
Vlad Zahorodnii 3d5b5844d0 Drop Cursor::image()
Use CursorSource::image() instead.

Cursor caching in the ScreenCastStream has been changed so
QImage::cacheKey() is not being used. This is rather a preparation for
making kwin grab the contents of the cursor scene.
1 year ago
Xaver Hugl f60bcfb646 handle laptop lid closing in KWin
Instead of KScreen turning the display off, do that in KWin directly
1 year ago
Xaver Hugl 6e9d5c2cc3 autotests: directly call setVirtualOutputs 1 year ago
Vlad Zahorodnii 1d1ccc3770 autotests: Rework _KDE_NET_WM_SCREEN_EDGE_SHOW test 1 year ago
Vlad Zahorodnii e6b5cf283e core: Batch pointer input device events
This change introduces InputDevice::pointerFrame(). The main motivation
behind it is to allow batching multiple pointer events within a single
event frame.

BUG: 454428
1 year ago
Vlad Zahorodnii 1f2a060a5e autotests: Remove WAYLAND_ONLY leftovers 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 076493cc05 autotests: Improve running time of testPointerInput 1 year ago
Vlad Zahorodnii 7b6eca612e Stop quick tile combine timer when activating a window
The quick tile test waits 1s to ensure that the quick tile combine timer
is not active. On the other hand, if the active window changes, it makes
sense to reset quick tile combine status. That also lets us get rid of
the QTest::qWait() in QuickTilingTest::testShortcut().
1 year ago
Andreas Cord-Landwehr 258e9d8426 Extend GLX switch to check if QtGui was being built with GLX plugin
Even though epoxy with GLX may be present, Qt's native interface only
exposes GLX API when it was being built with GLX support.
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
Xaver Hugl e7c803b7e5 backends/drm: store drm properties directly in drm objects
This makes it possible to ensure type safety for enums, as each drm property
object can have its own type now, and it reduces the amount of typing needed
to access properties
1 year ago
Xaver Hugl adc5104e2a autotests/drm: disable tests to work around FreeBSD CI issues
The tests don't do anything platform specific, so test only on Linux
until the cause of the problems is found
1 year ago
Vlad Zahorodnii 111e98d24a autotests: Remove render node check in testPointerInput
The test doesn't require OpenGL anymore.
1 year ago
Vlad Zahorodnii e3bc9e8ac6 autotests: Allow running lockscreen test with software rendering
The test needs OpenGL in order to ensure that the window view effect is
loaded and it registers a screen edge. On the other hand, we could
register a screen edge ourselves and thus allow running the test on
freebsd.
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 c54a324e99 autotests: Make PointerInputTest::testUnfocusedModifiers() less flaky
While 50ms is enough on dev machines, CI runners can be more loaded and
some events can arrive after more time.
1 year ago
Vlad Zahorodnii e0da725533 autotests: Fix Test::waitForWindowDestroyed
Before Deleted merge, it used to be equivalent to waiting until the
window is closed.

This fixes tests waiting until the window closing animation completes
and the Window object is destroyed.
1 year ago
Vlad Zahorodnii 9852748a84 autotests: Use software rendering in testPointerInput
testPointerInput requires OpenGL compositing because it wants to test
cursor push back in the window view effect and the window view effect is
available only if OpenGL is supported.

On the other hand, ScreenEdgesTest::testPushBack() already tests similar
scenario, so let's drop relevant test in testPointerInput to allow
running it when using software rendering.
1 year ago