Commit graph

20989 commits

Author SHA1 Message Date
Vlad Zahorodnii
7096e3ead8 Run clang-format
The .clang-format file is based on the one in ECM except the following
style options:

 - AlwaysBreakBeforeMultilineStrings
 - BinPackArguments
 - BinPackParameters
 - ColumnLimit
 - BreakBeforeBraces
 - KeepEmptyLinesAtTheStartOfBlocks
2022-03-25 13:25:15 +02:00
Volker Krause
68a8fa6034 Adapt to QQuickWindow graphics backend API changes in Qt6 2022-03-25 08:45:07 +00:00
Volker Krause
2a171e5fa8 Adapt build system to also support building against Qt6 2022-03-25 08:26:49 +00:00
l10n daemon script
fca6ffac7b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-03-25 01:47:05 +00:00
Volker Krause
5aae8c768a Port to qmlRegisterAnonymousType()
The anonymous variant of qmlRegisterType() is deprecated in Qt5 and
gone in Qt6.

This however now requires us to specify a module URI and major version
number. I used the names and (lowest) versions used already for other
types nearby where available, and fell back to "org.kde.kwin" and 0
otherwise.
2022-03-24 16:18:19 +00:00
Kai Uwe Broulik
3733abab2c scenes/opengl: Paint background with alpha 0
In conjunction with a buffer format with alpha channel this allows
to have KWin's backdrop transparent to see through to a display
layer below.

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-03-24 14:49:40 +00:00
Arjen Hiemstra
cb47df4fc4 Add a way to ignore devices for tablet mode
The tablet mode code checks whether we are currently in tablet mode
based on whether or not we have a touch screen and a pointer. For some
devices, a touch screen or pointer device may be detected but we would
like to ignore it, since it incorrectly influences the tablet mode.

This reads the udev tag "kwin_ignore_tabletmode" from libinput devices
and will skip devices with that tag when trying to determine whether we
are in tablet mode or not.
2022-03-24 14:59:04 +01:00
Kai Uwe Broulik
5f4a71904d Remove unused KColorScheme include
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-03-24 11:14:30 +00:00
David Edmundson
d1493295df Simplify ScreenLockerWatcher
ScreenLockerWatcher was written whislt overthinking DBus.

An interface does not have to have the same lifespan as the service the
other end. DBus connections works in terms of established "match rules",
these can be set up before a service is created the other side and they
remain if a service closes. The only part that needs doing is re-fetch
any cached properties.

There's also need to check the intial service names at startup. We can
just let our call to GetActive fail. It's far faster.

This class was getting convoluted in both ifdefs and Qt6 porting all to
solve something that isn't real.

There should be no behavioural differences.
2022-03-23 22:19:44 +00:00
Volker Krause
8feeda5c86 Adapt touch event code to Qt6 API changes
This is uglier with Qt6, as the setter methods for touch points are only
available as private API now.
2022-03-23 16:15:09 +00:00
Eric Edlund
1f8a65c434 Rename DEFAULT_MINIMUM_SCALE_DELTA in GestureRecognizer
This constant is now DEFAULT_UNIT_SCALE_DELTA.
This makes more sense now that we're using realtime gestures.
2022-03-23 09:49:35 +00:00
Vlad Zahorodnii
4854296b27 xwayland: Make launcher not force EGL_PLATFORM
It was added to work around Xwayland crashing at startup due to a mesa
issue, see commit 58fa92e40b.

It's been almost 6 years since that change. No other major wayland
compositor forces EGL_PLATFORM, so lets remove the workaround.

The main motivation behind this change is to get rid of code that's not
straightforward and should be unnecessary in general.
2022-03-23 08:41:11 +00:00
l10n daemon script
149f756ce8 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-03-23 02:09:06 +00:00
David Edmundson
2a6746a921 XWayland:split connection and process spawning
These are two conceptually different tasks that were intertwined.
On it's own it doesn't accomplish anything but is an important refactor
for longer term goals, namely:

- moving xwayland into kwin_wayland_wrapper with our wayland restart
handling support
- having multiple X connections

Behaviour should be the same.
2022-03-22 16:25:12 +00:00
Marco Martin
2b6f8a3141 support realtime activation for screen edges gestures
support realtime activation for screenedges gestures, making it possible
for effects to show half-triggered states while dragging from
the edge with a finger, making them much more usable
2022-03-22 20:28:02 +05:30
Vlad Zahorodnii
563e372440 autotests: Fix DBusInterfaceTest with KWIN_BUILD_ACTIVITIES=OFF
X11-specific code path was overlooked in
79a4733dc5.
2022-03-22 13:28:18 +02:00
Vlad Zahorodnii
f26c6ad5be plugins/screencast: Fix a glitch in cursor bitmap
In 52bc46069e, some code was shuffled
around to improve code readability. However, it was overlooked that
spa_meta_bitmap->offset is initialized too late, after QImage dest is
constructed. That's the reason why the left edge of the cursor is
wrapped around horizontally.

This change fixes the cursor glitch by ensuring that
spa_meta_bitmap->offset is initialized to proper value before getting
pointer to bitmap data. While on this, this change also moves
spa_meta_bitmap initialization code around to make spa_meta_bitmap setup
look less like a bowl of spaghetti, i.e. spa_meta_bitmap is initialized
first, and QImage dest is created with spa_meta_bitmap's values.
2022-03-22 10:36:32 +00:00
l10n daemon script
8e19f3149e SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-03-22 01:41:07 +00:00
Xaver Hugl
4a7007cd93 backends/drm: fall back to legacy mode in virtual machines
Virtual machines aren't properly supporting atomic mode setting yet, which
causes the cursor to be offset, and will cause more issues with overlay
planes. In order to prevent that from impacting users, fall back to legacy,
unless KWIN_DRM_NO_AMS is set.

BUG: 427060
FIXED-IN: 5.24.4
2022-03-21 21:28:18 +01:00
Alexander Lohnau
504e0e01cc Remove call to KQuickAddons::QtQuickSettings::init
This is now done as part of the plasma integration plugin.

Task: https://phabricator.kde.org/T12135
2022-03-21 16:49:22 +00:00
Xaver Hugl
7384405add backends/drm: set max bpc in DrmPipeline
If it's only set in DrmConnector it may be reverted if a test commit fails

CCBUG: 448220
2022-03-21 13:33:14 +00:00
Vlad Zahorodnii
6ea8463ce6 kwineffects: Rename WindowPrePaintData::clip to opaque
"opaque" is more readable than "clip" and it precisely communicates
what that region actually is.
2022-03-21 09:32:41 +02:00
Vlad Zahorodnii
842e46f86f scene: Work around some effects using optimized render path
Some effects (AnimationEffect) transform windows without setting
PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS flag. Make the scene disable
render optimizations if that's the case.

Whether AnimationEffect does a right thing is up to debate.
2022-03-21 09:32:41 +02:00
Vlad Zahorodnii
c65523382d scene: Simplify the management of opaque regions
Window painting is no longer split in two phases - PAINT_WINDOW_OPAQUE
and PAINT_WINDOW_TRANSLUCENT.

PAINT_WINDOW_TRANSLUCENT is used as a hint to the occlusion culling
logic to ignore the opaque region.

Given that, the handling of the opaque region can be simplified. If no
effect sets the PAINT_WINDOW_TRANSLUCENT flag, then the opaque region
can be used as is.
2022-03-21 09:32:41 +02:00
Vlad Zahorodnii
253b0ed808 scene: Rename Phase2Data::clip to Phase2Data::opaque
It makes code easier to understand.
2022-03-21 09:32:41 +02:00
Vlad Zahorodnii
aac0609bb9 scene: Rework surface damage tracking
It's not possible to get the surface damage before calling
Scene::paint(), which is a big problem because it blocks proper surface
damage and buffer damage calculation when walking render layer tree.

This change reworks the scene compositing stages to allow getting the
next surface damage before calling Scene::paint().

The main challenge is that the effects can expand the surface damage. We
have to call prePaintWindow() and prePaintScreen() before actually
starting painting. However, prePaintWindow() is called after starting
rendering.

This change makes Scene call prePaintWindow() and prePaintScreen() so
it's possible to know the surface damage beforehand. Unfortunately, it's
also a breaking change. Some fullscreen effects will have to adapt to
the new Scene paint order. Paint hooks will be invoked in the following
order:

* prePaintScreen() once per frame
* prePaintWindow() once per frame
* paintScreen() can be called multiple times
* paintWindow() can be called as many times as paintScreen()
* postPaintWindow() once per frame
* postPaintScreen() once per frame

After walking the render layer tree, the Compositor will poke the render
backend for the back buffer repair region and combine it with the
surface damage to get the buffer damage, which can be passed to the
render backend (in order to optimize performance with tiled gpus) and
Scene::paint(), which will determine what parts of the scene have to
repainted based on the buffer damage.
2022-03-21 09:32:41 +02:00
Vlad Zahorodnii
d4c44220b4 effects/desktopgrid: Make the desktop grid not depend on nested prePaintWindow()
This is needed to allow the Compositor get the surface damage before
calling Scene::paint().
2022-03-21 09:32:41 +02:00
Vlad Zahorodnii
0db64527f0 effects/slide: Make the slide effect not depend on nested prePaintWindow()
This is needed to allow the Compositor get the surface damage before
calling Scene::paint().
2022-03-21 09:32:41 +02:00
l10n daemon script
b6ec6f8216 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-03-21 01:44:58 +00:00
l10n daemon script
cdc85e95dc SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-03-20 02:11:23 +00:00
Volker Krause
31d9aa6914 Adapt to tablet event pointer type changes in Qt6 2022-03-19 16:42:23 +00:00
Vlad Zahorodnii
3c945358fc Revert "Implement desktopSwitching() interface for realtime animations"
This reverts commit c7c1ac78ea.

This change was merged prematurely.
2022-03-19 18:30:41 +02:00
Vlad Zahorodnii
e48357a130 Revert "rework of slide effect internals"
This reverts commit 3c557be707.

This change was merged prematurely.
2022-03-19 18:30:20 +02:00
Vlad Zahorodnii
d3acbf0127 Revert "make gestured desktop switching use natural directions"
This reverts commit 5d9e0be959.

This change was merged prematurely.
2022-03-19 18:29:48 +02:00
Vlad Zahorodnii
91632bd030 Revert "Refactor DEFAULT_MINIMUM_SCALE_DELTA in GestureRecognizer"
This reverts commit a508a8c6db.

It didn't go through code review process.
2022-03-19 18:29:39 +02:00
Vlad Zahorodnii
7e14716043 Revert "Make overview and present windows use realtime gestures"
This reverts commit 6729380c54.

It didn't go through code review process.
2022-03-19 18:29:26 +02:00
Eric Edlund
6729380c54 Make overview and present windows use realtime gestures
They still aren't realtime animated, but by making them respond to the
realtimeGesture() call, they can use callbacks to determine if they should be shown
or not. This allows you to swipe up, have it trigger, then swipe down in the same
motion and get it to untrigger without ever having to release.
2022-03-19 10:21:30 -04:00
Eric Edlund
a508a8c6db Refactor DEFAULT_MINIMUM_SCALE_DELTA in GestureRecognizer
This constant is not DEFAULT_UNIT_SCALE_DELTA.
This makes more sense now that we're using realtime gestures.
2022-03-19 10:06:01 -04:00
Eric Edlund
5d9e0be959 make gestured desktop switching use natural directions
BUG: 185710
2022-03-19 13:19:54 +00:00
Eric Edlund
3c557be707 rework of slide effect internals
Fixed a bunch of bugs and polished the slide effect.
Plugged the slide effect into the new VirtualDesktopManager interface desktopChanging() to allow for mac os style desktop switching.

BUG: 448419 BUG: 401479
2022-03-19 13:19:54 +00:00
Eric Edlund
c7c1ac78ea Implement desktopSwitching() interface for realtime animations
Added this interface to the VirtualDesktopManager. Realtime touchpad gestures update the interface to allow for mac os style desktop switching.
2022-03-19 13:19:54 +00:00
Volker Krause
ddaa2a3784 Make QDBusObjectPath debug output also work with Qt6 2022-03-19 11:24:31 +00:00
Volker Krause
bc7324d258 Remove unused CMake files 2022-03-19 11:24:13 +01:00
Volker Krause
c8b67b9120 Fix Qt6 build regressions introduced by 0cd453690b
Hard to avoid as long as we don't have CI coverage yet, but that will take
a bit more time, we need KWin (and all its dependencies) to fully build
first.
2022-03-19 10:00:12 +00:00
Volker Krause
b99c5f9a63 Adapt to QQuickWindow::createTextureFromNativeObject being gone in Qt6 2022-03-19 09:20:34 +00:00
Xaver Hugl
f31b4b36d7 backends/drm: only allow ARGB8888 as the cursor format
The raspberry pi exposes opaque formats for the cursor plane, and interprets
them as being opaque as well... Considering that we effectively don't support
anything else with the QPainter anyways, just hardcode ARGB8888 until we paint
the cursor with OpenGl.
2022-03-18 21:29:35 +00:00
Nate Graham
ec75943425 Revert "revert desktopgrid realtime gestures port"
This reverts commit ca7fc44814.

Reverting work with no explanation is unacceptable, especially when
you've already been asked to stop multiple times.

CWG has already been contacted regarding this conduct, which is
starting to seem like vandalism of KDE's codebase. I am CCing sysadmins
and officially recommending an emergency recovation of commit access
for uhhadd@gmail.com to prevent further abusive behavior.

CCMAIL: uhhadd@gmail.com
CCMAIL: sysadmin@kde.org
2022-03-18 13:51:15 -06:00
Jan Blackquill
ca7fc44814 revert desktopgrid realtime gestures port 2022-03-18 14:17:52 -04:00
Nate Graham
2de09fa249 Revert "revert desktopgrid realtime gestures port"
This reverts commit 154528cdef.

This commit was reverted with no explanation, context, or discussion. In
the future, please discuss things like this before doing them. KWin is a
community project, not a personal playground.

CCMAIL: uhhadd@gmail.com
2022-03-18 09:40:10 -06:00
Nicolas Fella
3876c89cc1 Avoid recreating palette in DecorationPalette::palette
KColorScheme::createApplicationPalette is quite expensive and DecorationPalette::palette is called quite a lot

Cache the result and only update when needed
2022-03-18 08:04:28 +00:00