1647 Commits (6bad553f05f459cd0f0d206db22215f1b049ddcc)

Author SHA1 Message Date
Arjen Hiemstra 6bad553f05 Temporarily disable testXkb and testX11Window
These prevent merging
11 months ago
Vlad Zahorodnii 8fbf287254 libkwineffects: Port to VirtualDesktop
This makes effects api consistent with the scripting api. In addition to
that, VirtualDesktop objects are more stable.
11 months ago
Xaver Hugl 8d25550c22 backends/drm: support applying icc profiles with color management
While applications are still restricted to sRGB, this allows working on sRGB
content on displays with a wide color gamut as the whole profile gets applied,
instead of just the VCGT.

CCBUG: 439135
11 months ago
Vlad Zahorodnii d7b1661e08 Merge libkwineffects into libkwin
libkwineffects was introduced when kwin used to be an executable. It
provided an api to implement effects and shielded from the technical
quirks in kwin.

Over the time, kwin internals had been split and abstractions were
refactored so they can be consumed in scripts or plugins. Besides that,
new ways to implement extensions have been introduced, which use
kwin's internal abstractions.

On the other hand, effects continue using libkwineffects specific apis.
This has a few issues: qtquick effects use both apis and it bites us,
duplicating same apis.

The best solution so far is to merge libkwineffects with libkwin, and
replace libkwineffects abstractions with libkwin abstractions, e.g.
EffectScreen -> Output, etc. This change takes care of adjusting libs.

Obviously, the main disadvantage of doing so is that binary effects
have to be recompiled every time new libkwin is released. But it's
already the case with libkwineffects too.
11 months ago
Vlad Zahorodnii 3bed991941 Link KI18n with libkwin privately 11 months ago
Aki Sakurai 115ea7454b Send tablet events to every bound wl_resource
Some apps, notably Tablet KCM, will rebind the tablet interface and consume all events that should be sent to the GUI toolkit.
This commit sends events to every consumer and also stores the latest cursor indexed by wl_client instead of wl_resource.
BUG:473126
11 months ago
Alexander Lohnau 0d3b017b23 Avoid QtDBus module include in commonly used headers
Because all of QtCore and QtDBus is no longer pulled in, a few placed had to get explicit includes
11 months ago
Kai Uwe Broulik 3eb90b2c60 Adjust to KDecoration init API returning a bool
Will allow a fallback to client-side decoration when KDecoration init fails.
11 months ago
Laurent Montel bc6116c5a7 There's no QVector anymore, QList is the QVector in Qt6 11 months ago
Alexander Lohnau 43174a9771 Remove X-Plasma-MainScript from C++ codepaths 11 months ago
Nicolas Fella 39fe6cd286 Remove window type from internal window and window system plugin
This is only set from KWindowSystem::setType(), which is unused on Wayland
11 months ago
Vlad Zahorodnii 5246d3924f wayland: Destroy ClientConnection immediately
With QObject::deleteLater(), the client object can unexpectedly outlive
the expected lifetime as in 03d0a226fb.
12 months ago
Vlad Zahorodnii 7e99ab9438 Build wayland tests with same build options as other tests 12 months ago
Vlad Zahorodnii 7d56aa3687 Merge wayland tests with other tests
This makes wayland tests organization consistent with other kwin tests.
12 months ago
Vlad Zahorodnii 9e10394db1 Move window specific signals from EffectsHandler to EffectWindow
This makes the api of EffectWindow more similar to the api of Window. It
also makes more sense to keep such signals in EffectWindow. In the future,
the effect window can be dropped in favor of the window.
12 months ago
Xaver Hugl ae84480fbf outputconfigurationstore: add new config system
Instead of an external service (like KScreen) storing and restoring output configurations,
with this commit KWin takes over that responsibility. This allows it to, among other things,
generate appropriate configs for new sets of outputs immediately, and take KWin-internal information
about outputs into account when generating them.

CCBUG: 474021
CCBUG: 469653
CCBUG: 466342
CCBUG: 470863
CCBUG: 466556
BUG: 466208
BUG: 455082
BUG: 457430
12 months ago
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