1050 Commits (master)

Author SHA1 Message Date
Xaver Hugl 28c27609a4 xdgshellwindow: enforce a minimum size for clients
It doesn't make sense for a window to become 1x1 pixels small. When we have
server side decorations we also know that the decoration takes a lot of
space, so this commit enforces a bigger minimum size for decorated windows

BUG: 469237
11 months ago
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 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
Vlad Zahorodnii 3bed991941 Link KI18n with libkwin privately 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 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 a5df88b0de libkwineffects: move linux kernel version query out of GLPlatform
It has nothing to do with OpenGL
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
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
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
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
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 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 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