Commit graph

21010 commits

Author SHA1 Message Date
Marco Martin
8e77cc497c Touch friendly changes for the Overview effect
* Makes the close button on thumbnails always visible: besides making it usable on touch, makes it more usable with mouse as well
* add a drag down gesture to close windows, moving opacity to zero while dragigng down to signal the window will be destroyed
* restore behavior animations: animate changes in thumbnails size or positions when not in drag mode or drag gesture to not make jarring sudden changes after closing a window or at end of drag mode
2022-03-30 08:33:30 +00:00
Vlad Zahorodnii
cc1bd42f16 Drop Screens::number() 2022-03-29 17:34:41 +00:00
Vlad Zahorodnii
66850e62a0 scripting: Provide clientArea() overloads that take VirtualDesktop objects 2022-03-29 17:34:41 +00:00
Vlad Zahorodnii
601ef328df Drop more legacy Workspace.clientArea() overloads
With this change, the Workspace would provide clientArea() overloads
that take only AbstractOutput and VirtualDesktop. integer ids are
obsolete as they are unstable.
2022-03-29 17:34:41 +00:00
Vlad Zahorodnii
3ebe480976 scene: Simplify optimized screen prepare pass 2022-03-29 14:38:18 +00:00
Xaver Hugl
658457df5f backends/drm: attempt a modeset on output disabling
When modesets are necessary, they are attempted when an output on the given
GPU gets presented. With multi-gpu setups however, the situation can arise
where there is only one disabled output on a GPU; in that case KWin eternally
waits and never properly turns off the display.
In order to work around this, explicitly call DrmGpu::maybeModeset when
an output gets disabled.

BUG: 449878
FIXED-IN: 5.24.4
2022-03-29 09:19:57 +00:00
Fushan Wen
5427b4d4da tabbox: Don't play "Show Desktop Animation" when activating from tabbox
We already show the desktop preview when the "Show Desktop" item is focused,
so the animation should be considered redundant.
2022-03-29 03:46:31 +00:00
Fushan Wen
0ded63c464 effects: Don't emit showingDesktopChanged when animated is false 2022-03-29 03:46:31 +00:00
Fushan Wen
c85bb35c98 workspace: Add animated in setShowingDesktop
When `animated` is false, "Show Desktop Animation" should not be played.
2022-03-29 03:46:31 +00:00
l10n daemon script
1a6ebab865 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-29 02:16:07 +00:00
Volker Krause
95505eb044 Adapt to OpenGL related Qt6 QQuickWindow API changes 2022-03-28 14:57:27 +00:00
Aleix Pol
4009345e10 Remove unnecessary Scene::addRepaint(QRect)
We can implicitly convert QRect into QRegion.
2022-03-28 12:52:09 +00:00
Aleix Pol
fd1dd4f915 --warning: Remove unused local variable 2022-03-28 12:52:09 +00:00
Vlad Zahorodnii
e293972eaa Run clang-tidy with -checks=readability-braces-around-statements fixit
This fixes style issues in old code.
2022-03-28 10:54:11 +00:00
Kai Uwe Broulik
0d223742ab kwineffects: Add OffscreenQuickScene::setSource with initial properties
Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-03-28 09:47:48 +00:00
Vlad Zahorodnii
19a18e4b5d Clean up QPalette handling in DecorationPalette
When using a "legacy" colorscheme, the QPalette will be loaded twice.
With this change, the QPalette is going to be created only once. It also
cleans up variable naming.
2022-03-28 09:17:25 +00:00
l10n daemon script
e14d31a11a 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-28 01:44:20 +00:00
Xaver Hugl
8914a6c50e add global touchscreen gestures
Swipe with three fingers
- left to switch to the previous virtual desktop
- right to switch to the next virtual desktop
- up and down to toggle the overview

CCBUG: 439925
2022-03-27 19:09:04 +02:00
l10n daemon script
0aab6e3ee5 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-27 01:50:57 +00:00
Volker Krause
648640f9ad Include KF headers properly
With the recent KWayland changes we can build without 4 era legacy include
paths now, which makes this visible.
2022-03-25 16:15:10 +01:00
Vlad Zahorodnii
8fe567c4fa Add pre-commit hook for clang-format 2022-03-25 13:25:20 +02:00
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