Commit graph

21117 commits

Author SHA1 Message Date
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
Vlad Zahorodnii
645f5adfc2 Remove guards around unistd.h
We take unistd.h for granted in many places, so remove guards around the
corresponding includes to make code consistent.
2022-03-18 07:35:59 +00:00
l10n daemon script
af5e8a937d 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-18 01:50:19 +00:00
Mathias Tillman
140c2fb20e effects/blur: Fix window flickering when the clip intersected with the current blur region.
This fixes a bug introduced in https://invent.kde.org/plasma/kwin/-/merge_requests/2045 where it would no longer check if it should redraw the whole region unless the data clip intersected. This would lead to flickering in certain cases

BUG: 421135
2022-03-17 22:19:55 +00:00
Vlad Zahorodnii
927714466c Remove KWIN_XCLIPBOARD_SYNC_BIN symbol in config-kwin.h
xclipboard syncer is long time gone.
2022-03-17 12:05:45 +02:00
Alex Richardson
137fea8aa9 Use #cmakedefine01 for the remaining config macros
Using 0/1 instead of undefined/defined to 1 allows the compiler to flag
a missing include of the config header.
2022-03-17 11:40:01 +02:00
Alex Richardson
0a0a1fd330 Use __has_include() instead of check_include_file()
Allows removing some CMake checks config-kwin.h contents. This is
supported by all compilers and required for C++17. While touching those
lines I also cleaned up an unnecessary HAVE_UNISTD_H check (glibc always
has it and and incorrect use of HAVE_SYS_PROCCTL_H.
2022-03-17 11:39:58 +02:00
Vlad Zahorodnii
994c5c24ae Drop fbdev backend
fbdev has been deprecated and unmaintained for a while. With Linux 5.14
including SimpleDRM driver, we can drop it. (at the time of writing this
commit message, the latest Linux version is 5.16).
2022-03-17 09:13:21 +00:00
Julius Zint
39160e7dbd Remove no_xdg_runtime_dir_test
[6/6] Make autotests create fake input devices

This test was the only one where input() could return a nullptr. With
this test removed, autotests can now expect input() to always return a
sane valid value and are therefor simpler to write.

That test belongs in kwayland-server anyway and kwayland-server's test
suite already tests that starting without XDG_RUNTIME_DIR is a no-no
thing
2022-03-17 08:35:40 +00:00
Julius Zint
270a963350 Migrate all autotest input simulation functions
[5/6] Make autotests create fake input devices

Migrate all input simulation functions from kwinApp()->platform()->...
to the their counter part in the Test namespace.
2022-03-17 08:35:40 +00:00
Julius Zint
93305f6041 Add all required input simulation methods
[4/6] Make autotests create fake input devices

This translates all required input simulating methods from
kwinApp()->platform()->... to seperate functions in the Test namespace.
2022-03-17 08:35:40 +00:00
Julius Zint
33487c06d6 Add all three VirtualInputDevices for autotests
[3/6] Make autotests create fake input devices

This commit adds back all three VirtualInputDevices for simulating
keyboard, touch and pointer input events from autotests.
2022-03-17 08:35:40 +00:00
Julius Zint
97f49edb1c Add the ability to add InputDevices to InputRedirection
[2/6] Make autotests create fake input devices
2022-03-17 08:35:40 +00:00
Julius Zint
3134198a30 Move VirtualInputDevice to autotests
[1/6] Make autotests create fake input devices

The goal of this patch set is simulating user input in unit tests via
InputDevices and no longer use the Platform to fake input. This matches
more closely with how input is processed when running a full plasma
wayland session, i.e. with the DRM and libinput backends.
2022-03-17 08:35:40 +00:00
Volker Krause
4b810833b5 Use new nativeInterface() API to get EGL/GLX contexts with Qt6 2022-03-17 07:54:26 +00:00
Volker Krause
1679452f41 Adapt to QChar ctors being explicit in Qt6 2022-03-17 07:29:51 +00:00
Nate Graham
840e6d400b src/kcmkwin: fix botched indentation code for final checkbox
This line had several problems:
1. Using un-namespaced `units` properties
2. Using `width` in a Layout
3. Using largeSpacing instead of gridUnit for indentation

All are fixed with ths commit.
2022-03-16 20:30:49 -06:00
l10n daemon script
17d562c825 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-17 01:47:48 +00:00
Volker Krause
15611cacb9 Port from QStringRef to QStringView
The QStringView::to[Number]() methods in Qt5 cause one extra allocation
compared to the QStringRef counter-part. As long as we aren't on a hot
path this is probably not worth the extra #ifdef though.
2022-03-16 23:44:23 +00:00
Michail Vourlakos
ba2496ca12 [aurorae] do not make any blur calculations when blur is not supported
when an aurorae theme does not contain "mask" element we can safely assume that blur is not supported. In such case all blur calculations must not run at all. This will make all solid aurorae themes much lighter by default.
2022-03-16 23:42:46 +00:00
Jan Blackquill
154528cdef revert desktopgrid realtime gestures port 2022-03-16 17:14:59 -04:00
Xaver Hugl
1d1b218d97 screencast: better solution for missing context on cursor move
There's no need to use tryEnqueue if we only update the cursor
2022-03-16 17:41:50 +00:00
Xaver Hugl
989361405e Revert "screencast: make context current in tryEnqueue"
This reverts commit 1fd1c03742,
because it can make KWin freeze
2022-03-16 17:41:50 +00:00