Commit graph

1137 commits

Author SHA1 Message Date
Vlad Zahorodnii
4af9d6c234 kwineffects: Remove unused WindowVertex and WindowQuad props
Since window quads are no longer passed in prePaintWindow(), we don't
need to track original vertex coords. This results in smaller memory
footprint.
2021-06-14 07:56:02 +00:00
Vlad Zahorodnii
49744cfc53 scene: Improve window quad management
At the moment, we handle window quads inefficiently. Window quads from
all items are merged into a single list just to be broken up again.

This change removes window quads from libkwineffects. This allows us to
handle window quads efficiently. Furthermore, we could optimize methods
such as WindowVertex::left() and so on. KWin spends reasonable amount
of time in those methods when many windows have to be composited.

It's a necessary prerequisite for making wl_surface painting code role
agnostic.
2021-06-14 07:56:02 +00:00
Vlad Zahorodnii
29cc319455 kwineffects: Remove WindowQuadType
The window quad type has become irrelevant.
2021-06-14 07:56:02 +00:00
Vlad Zahorodnii
43106b7e5d autotests: Remove SceneOpenGLShadowTest
It's barely readable and it doesn't add any real value.
2021-06-11 06:03:08 +00:00
Vlad Zahorodnii
de122825fd scenes/qpainter: Remove support for drop-shadows
Drop-shadows with the software render backend impact performance quite
significantly. It also makes it easier to prepare render backends for the
item based design.
2021-06-11 06:03:08 +00:00
Vlad Zahorodnii
30d0dbbaf0 Remove EffectsHandler::buildQuads()
It's currently unused and it doesn't fit the item based scene design.
2021-06-11 06:03:08 +00:00
Vlad Zahorodnii
a06690021d Remove OpenGL2Compositing enum
OpenGLCompositing and OpenGL2Compositing enums mean de-facto the same
thing, it's confusing to have them both.
2021-06-09 15:24:22 +00:00
Vlad Zahorodnii
811beb94e0 Remove Xrender backend
The Xrender backend was added at the time when OpenGL drivers were not
particularly stable. Nowadays though, it's a totally different situation.

The OpenGL render backend has been the default one for many years. It's
quite stable, and it allows implementing many advanced features that
other render backends don't.

Many features are not tested with it during the development cycle; the
only time when it is noticed is when changes in other parts of kwin break
the build in the xrender backend. Effectively, the xrender backend is
unmaintained nowadays.

Given that the xrender backend is effectively unmaintained and our focus
being shifted towards wayland, this change drops the xrender backend in
favor of the opengl backend.

Besides being de-facto unmaintained, another issue is that QtQuick does
not support and most likely will never support the Xrender API. This
poses a problem as we want thumbnail items to be natively integrated in
the qtquick scene graph.
2021-06-09 11:21:57 +03:00
Vlad Zahorodnii
3c2ca184e3 effects: Remove Desktop Cube Animation effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Vlad Zahorodnii
47ef0b5a3c effects: Remove Desktop Cube effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Vlad Zahorodnii
3722c21660 effects: Remove Cover Switch effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Vlad Zahorodnii
bcff948e39 effects: Remove Flip Switch effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Vlad Zahorodnii
1b2c7b248b Run clazy with qt-keywords fixit
In C++20, there will be emit() class member, which can conflict with the
emit keyword. Given that, there are plans to enable QT_NO_KEYWORDS by
default in the future.

See also
https://lists.qt-project.org/pipermail/development/2020-February/038812.html
2021-06-08 10:49:42 +03:00
Alexander Lohnau
9c689d7ddb plugins: Port away from deprecated version checks
Task: https://phabricator.kde.org/T14302
2021-06-07 15:01:19 +00:00
Nicolas Fella
f910b0de97 Use version-less qt DBus macros
They work with both Qt5 and Qt6
2021-05-31 01:00:35 +02:00
Vlad Zahorodnii
b814b3c985 kwineffects: Add client geometry property
This property can be useful for the screenshot effect.
2021-05-28 11:05:38 +03:00
Vlad Zahorodnii
9a7ab8a62e Rework async geometry updates
Window management features were written with synchronous geometry
updates in mind. Currently, this poses a big problem on Wayland because
geometry updates are done in asynchronous fashion there.

At the moment, geometry is updated in a so called pseudo-asynchronous
fashion, meaning that the frame geometry will be reset to the old value
once geometry updates are unblocked. The main drawback of this approach
is that it is too error prone, the data flow is hard to comprehend, etc.

It is worth noting that there is already a machinery to perform async
geometry which is used during interactive move/resize operations.

This change extends the move/resize geometry usage beyond interactive
move/resize to make asynchronous geometry updates less error prone and
easier to comprehend.

With the proposed solution, all geometry updates must be done on the
move/resize geometry first. After that, the new geometry is passed on to
the Client-specific implementation of moveResizeInternal().

To be more specific, the frameGeometry() returns the current frame
geometry, it is primarily useful only to the scene. If you want to move
or resize a window, you need to use moveResizeGeometry() because it
corresponds to the last requested frame geometry.

It is worth noting that the moveResizeGeometry() returns the desired
bounding geometry. The client may commit the xdg_toplevel surface with a
slightly smaller window geometry, for example to enforce a specific
aspect ratio. The client is not allowed to resize beyond the size as
indicated in moveResizeGeometry().

The data flow is very simple: moveResize() updates the move/resize
geometry and calls the client-specific implementation of the
moveResizeInternal() method. Based on whether a configure event is
needed, moveResizeInternal() will update the frameGeometry() either
immediately or after the client commits a new buffer.

Unfortunately, both the compositor and xdg-shell clients try to update
the window geometry. It means that it's possible to have conflicts
between the two. With this change, the compositor's move resize geometry
will be synced only if there are no pending configure events, meaning
that the user doesn't try to resize the window.
2021-05-25 06:17:41 +00:00
Vlad Zahorodnii
e4ec955d88 Remove shadow related bits in Scene::Window 2021-05-19 14:13:47 +03:00
Vlad Zahorodnii
edb7867ee9 Prepend "Interactive" to interactive move resize methods
This is to improve code readability and make it easier to differentiate
between methods that are used during interactive move-resize and normal
move-resize methods in the future.
2021-05-16 13:50:25 +03:00
Vlad Zahorodnii
4ba249eee5 wayland: Signal about finished move/resize in destroyClient()
We need to emit the clientFinishUserMovedResized signal to notify
effects such as translucency that the interactive move-resize is
finished. Otherwise, the set() animation won't be cancelled and the
window will get stuck frozen.

BUG: 409376
2021-05-16 10:46:57 +00:00
Vlad Zahorodnii
07c4057180 autotests: Stabilize tests that create Xwayland windows
The order in which Xwayland surfaces are associated with X11 windows is
undefined, meaning that we cannot assume that a newly created X11 window
won't have a surface associated with it already.
2021-05-15 16:16:48 +00:00
Vlad Zahorodnii
b6dd7c5860 autotests: Introduce own idle inhibit v1 helpers
Non-core wrappers in kwayland are deprecated. qtwaylandscanner needs to
be used instead for generating client-side wrappers.
2021-05-14 05:36:08 +00:00
Vlad Zahorodnii
7d0cad07fb autotests: Fix XwaylandInputTest
For some reason, Xwayland doesn't like starting without outputs. If
outputs are added later, it sends bogus EnterNotify and LeaveNotify
events.
2021-05-13 11:44:41 +00:00
Aleix Pol
b7389c6f1a libinput tests: Fix new-delete-type-mismatch error when using ASAN 2021-05-13 06:53:13 +00:00
Vlad Zahorodnii
7475385c82 Make scale and glide effect ignore lockscreen greeter
On X11, the lockscreen greeter is an override-redirect window so the
scale and the glide effect ignore it.

On Wayland, the lockscreen greeter is a regular window so both effects
try to animate it upon the screen being unlocked, which looks bad.
2021-05-13 05:46:30 +00:00
Vlad Zahorodnii
0f60cc68a9 autotests: Prefer stackingOrder() over xStackingOrder()
This reduces the number of usages of xStackingOrder(), which simplifies
the reasoning about when it can be marked as dirty.

Since internal windows are now in the regular stack, InternalWindowTest
can use stackingOrder().

As for X11ClientTest, there's no specific reason why it uses the x stack
instead of the regular one.
2021-05-13 04:58:45 +00:00
Vlad Zahorodnii
d78d686690 autotests: Stabilize ActivationTest::testSwitchToWindowMaximized 2021-05-12 20:44:28 +03:00
Vlad Zahorodnii
c9ee2f06db autotests: Fix testActivation
Currently there's a race condition with regards to the first configure
event with the activated state.
2021-05-12 19:21:38 +03:00
Aleix Pol
69b7b523f8 Make MoveResizeWindowTest::testGrowShrink more reliable
We need to make sure that the information from
toplevelConfigureRequestedSpy is in place to be used, otherwise we get
an empty size and it doesn't work.
2021-05-12 10:43:28 +00:00
Aleix Pol
f6c2861b73 strutstest: fix top panel/ivnalid strut 2
The client area is detected as invalid and ignored by
Workspace::updateClientArea.
2021-05-12 10:43:03 +00:00
Aleix Pol
35970686e1 Implement ping on tests
Otherwise there's no pong and we get unnecessary noise.
2021-05-12 10:42:34 +00:00
Aleix Pol
92e0357fef InputMethodTest: provide a process to launch when we need a virtual keyboard
Otherwise it never claims to be active.
2021-05-11 12:47:41 +02:00
Aleix Pol
341ec55c9e InputMethodTest: Use InputMethod::isActive as a way to check if it's activated
Instead of looking for a client, which is a bit more of a hit and miss,
since the client doesn't need to be registered when the test expects it
to.
2021-05-11 12:47:27 +02:00
Aleix Pol
c8a1f48151 GlobalShortcutsTest: No need to make the test longer than it needs to be 2021-05-11 12:38:00 +02:00
Aleix Pol
8cbc03b3be GlobalShortcutsTest: Support running the test without xwayland 2021-05-11 12:38:00 +02:00
Aleix Pol
a977ba3311 GlobalShortcutsTest: Fix testNonLatinLayout
Have it switch back from the Russian layout, otherwise the rest of tests
are run with this one and fail as they produce weird shortcuts.
2021-05-11 12:38:00 +02:00
Vlad Zahorodnii
282e0d1c4d autotests: Port the tests to new xdg-shell helpers 2021-05-11 05:26:51 +00:00
Aleix Pol
8cfa30803b Fix InternalWindowTest::testDismissPopup
We were expecting a tooltip to be closed when clicking its
transientParent, but it's explicitly not something we are after. We
close popups when we click either other clients or the actual client on
the decoration.

This change makes it so we end up clicking another window instead of the
parent one that is unrelated.
2021-05-11 00:05:37 +00:00
Aleix Pol
a3d32fa836 Ensure we start our tests with wayland already initialised
When debugging modifier_only_shortcut_test in _waylandonly mode I saw
that it was failing, among other things, because some aspects were not
initialised.

This changes every test we have to run the new
Test::initWaylandWorkspace() that calls waylandServer()->initWorkspace()
but also makes sure that WaylandServer::initialized is emitted before we
proceed.
2021-05-10 12:33:43 +00:00
Vlad Zahorodnii
5739603145 autotests: Fix kglobalaccel integration
Starting with 48c3376927e5e9c13377bf3cfc8b0c411783e7f3 in kglobalaccel,
KGlobalAccel won't work in desktop environments other than Plasma.

We need to set XDG_CURRENT_DESKTOP=KDE to ensure that global shortcuts
still work.
2021-05-05 09:16:58 +03:00
Vlad Zahorodnii
a0fc0277a7 wayland: Make fullscreen mode updates async
Currently, the fullscreen state is update synchronously, but it needs to
be done in asynchronous fashion.

This change removes some tests as they don't add any value, testFullscreen()
covers them all.
2021-05-05 06:11:42 +00:00
Vlad Zahorodnii
403a04fe24 wayland: Fix loading of HiDPI cursors
Xcursors don't support hidpi so if a hidpi cursor is needed, kwin will
scale the desired size by the scale factor and ask Xcursor helpers to
load a theme with the given name and the size.

However, the theme loading code doesn't take into account that Xcursor
theme loading helpers may not return cursor sprites of size size * scale
if the theme has no such a size.

For example, if the cursor theme only provides 24, 36, and 48 sizes and
kwin attempts to load cursors of size 48 with a scale factor of 2, we
will get cursors of size 48 instead of 96. Unfortunately, this will
result in the issue where the cursor shrinks when hovering decorations
because kwin doesn't know that the effective scale factor (1) is
different from the requested scale factor (2).

In order to fix loading of HiDPI cursors, we need to approximate the
effective scale factor of every cursor sprite as we load it.
2021-05-03 10:52:25 +03:00
Aleix Pol
050ce24247 inputmethod: Move the input method process into the InputMethod class
Use the control this gives us for stopping the input method process when
we disable.
2021-04-29 11:04:19 +00:00
Vlad Zahorodnii
ac3c09ba75 Remove Platform::areOutputsEnabled()
This flag is redundant. If an output is disabled, the compositor won't
attempt to perform compositing on it.
2021-04-29 10:47:41 +00:00
Xaver Hugl
2aae299eba Fix testScreens 2021-04-26 19:25:50 +00:00
Vlad Zahorodnii
6a57fa286e autotests: Fix a few typos in kwinglplatformtest 2021-04-26 13:26:05 +03:00
Tomasz Paweł Gajc
e9fcd9584e effects: add support Panfrost Mali driver 2021-04-24 16:04:44 +02:00
Vlad Zahorodnii
9ad83dafe6 autotests: Fix InputMethodTest
Currently, the test fails because the d-bus api was changed recently.
Use InputMethod::setEnabled() method to enable input method support.
2021-04-23 22:08:29 +03:00
Vlad Zahorodnii
c894956bba autotests: Fix testVirtualKeyboardDBus 2021-04-23 21:40:04 +03:00
Vlad Zahorodnii
9fe53ee062 autotests: Fix DontCrashCursorPhysicalSizeEmpty 2021-04-23 09:55:04 +03:00