1631 Commits (a16506c665c856621e5ff83fc2ae4964f27f928e)

Author SHA1 Message Date
Vlad Zahorodnii dc6dba231d Port away from KWayland's server-decoration implementation 1 year ago
Vlad Zahorodnii 6029a68433 backends/fakeinput: Implement fake-input v5 1 year 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
Vlad Zahorodnii 15ed4f393e wayland: Simplify startup of compositor
At the moment, the wayland compositor has to handle the case of having
no workspace. This should be unnecessary and it creates a pesky cycling
dependency between Workspace and Compositor.

Given that the Workspace acts more like a container and kwin starts
accepting client connections after starting compositing, it's possible
to create the Workspace earlier and simplify the start() function a bit.
1 year ago
Vlad Zahorodnii de36fe82e8 wayland: Integrate KWaylandServer classes into KWin namespace 1 year ago
Vlad Zahorodnii 8bf2318800 wayland: Drop "_interface" from filenames
The cpp files in the wayland directory are named after protocol names.
"_interface" does not contribute anything new.
1 year ago
Vlad Zahorodnii 67dcf53e80 autotests: Add more test cases in LayerShellV1WindowTest::testPlacementArea 1 year ago
Vlad Zahorodnii 7d626363e4 autotests: Remove old kernel checks
CI runners have been upgraded.
1 year ago
Xaver Hugl 32ae9dd7d1 libkwineffects: rename major and minor methods
There's "major" and "minor" defines that can get implicitly included, for
example with musl libc. To prevent that from breaking compilation, rename
the methods
1 year ago
Vlad Zahorodnii 6dd6e176e3 Move X11Compositor and WaylandCompositor in their own files 1 year ago
Vlad Zahorodnii 14ab38b596 composite.h -> compositor.h 1 year ago
Vlad Zahorodnii 9cf6011ba4 autotests: Don't be so paranoid about compositing type
In many cases it's irrelevant, what we care about is whether given effect
is loaded and performs its function. So remove these paranoid checks
except the tests where it's important to use OpenGL compositing.
1 year ago
Xaver Hugl e401f3ff11 libkwineffects: drop gallium detection
It's not used anywhere
1 year ago
Xaver Hugl 6d35a27f90 libkwineffects: drop checks for GLSL and NPOT
Instead, creating contexts that miss these features should fail directly,
making KWin fall back to software rendering.
While this commit also drops workarounds for broken drivers that do software
emulation for features we need, such workarounds belong into these drivers and
the user can still manually turn off compositing if needed.
1 year ago
Xaver Hugl ed02051a4a libkwineffects: move x server version query to xcb utils 1 year ago
Xaver Hugl a5df88b0de libkwineffects: move linux kernel version query out of GLPlatform
It has nothing to do with OpenGL
1 year ago
Xaver Hugl e0c7878357 libkwineffects: move version into its own files 1 year ago
Xaver Hugl 5ce02c6811 libkwineffects: drop limited glsl detection
It's not actually used anywhere
1 year ago
Xaver Hugl 27f90476b4 libkwineffects: rename kwingl* files to gl* 1 year ago
Mikhail Vinogradov 82be16df29 Try to refresh textInput active focus status 1 year ago
Xaver Hugl 1c18d11206 backends/drm: replace drmModeAtomicCommit with a custom implementation
drmModeAtomicCommit does additional allocations and sorting that KWin doesn't
use or need
1 year ago
Vlad Zahorodnii dee8a3b3a7 Clear decoration focus when window closes
If the window closes, we need to reset the focused decoration object.

BUG: 473244
1 year ago
David Edmundson 10ed34bc9d Avoid painting unchanged scene layers
Currently when we move the mouse the one render loop triggers a repaint.
When the cursor layer needs a new update we end up in the compositor
repainting the main content.

Even though painting should mostly no-op it still goes through all
existing items and effects to collect damage, still potentially making
the GL context current which could stall. A waste when we know we
haven't got anything to do. It's enough to cause noticable mouse lag on
some hardware.

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
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 d25574e7c6 Merge Window::userCanSetFullscreen() with Window::isFullscreenable() 1 year ago
Vlad Zahorodnii 346d4413a1 Remove boolean trap in Window::setFullScreen()
In most cases, it doesn't matter because a window is made fullscreen by
user. In a few places, the user arg is incorrectly set to false.
1 year ago
Xaver Hugl 44937136cd backends: record GPU render time
This should make it much less likely for KWin to miss frames
1 year ago
Xaver Hugl 02b996cf9c platformsupport/scenes/opengl: add opengl render query class 1 year ago
Xaver Hugl 0ab928c9ac backends/libinput: enable tap to click and tap-and-drag by default 1 year ago
Kai Uwe Broulik 410ca44e6e XdgPopupWindow: Reposition for non-reactive positioners
Ensures that e.g. context menus move about with their parents when they
get moved around.

However, as per spec don't re-constrain the window when its positioner
is non-reactive. This change calculates the offset from its parent window
once initially and places the window relative to that whenever the parent
moves.

Only when the positioner is reactive, will it recalculate the placement fully.

BUG: 461994
1 year ago
Xaver Hugl 74f10d0cdf port most uses of the reset(new ...) pattern to std::make_unique 1 year ago
Antonio Russo 5502ce9a9c placeSmart: Properly track width and height
`Placements::placeSmart` searches for an optimal position for windows, attempting to minimize overlap.  The core of this algorithm tracks the
client's height and width in `ch` and `cw`, which have been adjusted by -1. This simplifies logic determining the bottom and right points of a
window when you are starting at the top and left points.

However, this decision requires adjusting that number by +1 when doing the opposite: determining the top and left points when you start with
the bottom and right points.

placeSmart cycles through window locations, searching for acceptable nooks and crannies to fit a window in, nicely.  It begins by checking
for places to put the top left corner of the window which abut another constraint.  If that fails, it then tries to place the bottom right
abutting a constraining feature.

After finding a suitable bottom (or right) location, the top (or left) location must be determined, requiring the -1 adjustment to be undone.

This patch adds that +1 back in.

# The bug it solves

This error can be seen by opening a bunch of windows that are placed using the "Minimal Overlapping" rule.  The open space on the screen will be tiled from left to right, and then top to bottom in the windows.  Once no more windows can be placed like that, the next window will be placed at the extreme bottom-right corner.  However, it will be one pixel too low and one pixel too far to the right---if you try to move the window, it will "snap" to the correct spot.

This single pixel may seem minor or even irrelevant, but when you use the "Present Windows" desktop effect on a multiple-monitor setup, this one pixel will cause the window to show up on both monitors.
1 year ago
Xaver Hugl 7d02bc17d6 backends/drm: rework how atomic commits are tracked
Pending buffers for drm planes and crtcs are no longer tracked in the planes
and crtcs themselves, but instead in a DrmCommit object that is used as
the user data for the pageflip handler. This way multiple commits can be
pending at the same time without causing conflicts, and the handling of
pending buffers is simplified as well.
1 year ago
Xaver Hugl 87444f6ce3 backends/drm: offload atomic commits to a separate thread
This separate thread submits commits as late as possible, so that until
immediately before vblank the cursor position can still be updated, reducing
its latency and opening the door for more optimizations.
1 year ago
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