Commit graph

1159 commits

Author SHA1 Message Date
Vlad Zahorodnii
5bbd21f682 autotests: Port away from deprecated clientArea() overloads 2021-08-25 18:53:53 +00:00
Vlad Zahorodnii
78b5330824 Drop VirtualDesktopManager::name()
It's confusing to have two ways to query the same information.
2021-08-25 20:12:07 +03:00
Aleix Pol
9a4bbdf226 Make it possible for an effect to render a screen
Useful in case it needs the contents of the screen but they can't be
blitted, as the state of the framebuffer is unknown.
2021-08-25 14:44:03 +00:00
Vlad Zahorodnii
fddbd57d09 Port Workspace::clientArea() to VirtualDesktop
This makes Workspace APIs that take virtual desktops more consistent.
2021-08-25 14:31:30 +00:00
Vlad Zahorodnii
ba0f5981bf Port Workspace::slotWindowToDesktop*() to VirtualDesktop 2021-08-19 11:08:32 +00:00
Vlad Zahorodnii
6132329c2c Add Overview effect
This effect is meant to be as a replacement for the present windows and
the desktop grid effect. It is written using QML.

So far, this effect implements only the basic features of the present
windows effect. Desktop management features will be added later.

CCBUG: 295775
CCBUG: 303438
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
b75f089981 Port Workspace::topClientOnDesktop() to VirtualDesktop
This patch has one behavioral change - raiseOrLowerClient() will not
work if the client is not on the current virtual desktop.

However, raiseOrLowerClient() can be called only in two cases:

* user triggers the raise or lower shortcut for the active client. Since
  the active client is on the current virtual desktop, it's not an issue

* an x11 window restacks itself. It makes no sense if an x11 window
  restacks itself while it's inactive or not on current virtual desktop.
  Also, the Opposite restack mode is rarely used, some window managers
  don't even bother implementing it. So, having such a constraint should
  not be a problem.

The main reason for not allowing raiseOrLowerClient() for windows that
are not on the current virtual desktop is that a window can be on
multiple virtual desktops. If a window is on A and B virtual desktops,
the only logical option is to toggle stacking position if the window is
on the current desktop. It's the only viable option as kwin does not
maintain per virtual desktop stacking order.
2021-08-17 06:23:52 +00:00
Vlad Zahorodnii
a13fd02ea8 Remove virtualdesktops.h include in toplevel.h
toplevel.h is included in many places. Changing virtualdesktops.h may
trigger rebuild of all kwin.

With this change, only cpp files that use virtualdesktops.h will need to
be recompiled.
2021-08-12 17:23:15 +00:00
Aleix Pol
53dcd205c6 inputmethod: Add a test that simulates client switching 2021-07-31 02:10:17 +02:00
Vlad Zahorodnii
964c487d4f wayland: Switch to ClientBuffer
The main motivation behind the split is to simplify client buffer code
and allow adding new features easier, for example referencing the shm
pool when a shm buffer is destroyed, or monitoring for readable linux
dmabuf file descriptors, etc.

Also, a referenced ClientBuffer cannot be destroyed, unlike the old
BufferInterface.
2021-07-23 15:33:38 +00:00
Nicolas Fella
25b85607d0 Port from KPluginLoader::pluginsById to KPluginMetaData::pluginById
The latter gives us only a single plugin which makes the code a bit more concise
2021-07-22 22:59:13 +02:00
Aleix Pol
26fd5d3667 inputmethod: Remove workaround 2021-07-21 13:10:30 +02:00
Aleix Pol
422522d15b inputmethod: Also expose the visibility on dbus
Since we adapted inputmethod to support methods like ibus, the input
method can be active but not have a visible panel.
This includes an extra property that will indicate us if the panel is
visible at any time. This will allow us to properly render the virtual
keyboard hide button in Plasma Mobile (or wherever we need it).
2021-07-21 13:10:30 +02:00
Aleix Pol
abf22570c7 inputmethod: Reduce consecutive activation+deactivation+activation sequences
So far calling setActive(true) would issue a deactivation then another
activation. This sometimes makes maliit crash and we can achieve the
same result just by just issuing a reset.
2021-07-21 13:10:30 +02:00
Aleix Pol
9b5b02c957 kwin tests: Add heplers to access the input panel client and its surface
It's useful when dealing with unit tests for input methods
2021-07-21 13:10:30 +02:00
Xaver Hugl
da71d218c8 platforms/drm: refactor the gbm surface 2021-07-10 20:13:01 +02:00
Vlad Zahorodnii
fac33750f9 effects: Remove shape property
It's unused and the advantages of keeping it are outweighed by the
disadvantages - the returned value is dependant on the window type.

If you need to draw a drop-shadow that matches the shape of the window
or something along that line, render the window into an offscreen
texture and sample the alpha channel in a fragment shader.
2021-06-23 11:21:51 +00:00
Vlad Zahorodnii
0e9ab1fced autotests: Fix TestBuiltInEffectLoader
The looking glass effect creates an opengl texture at load time without
a current context, which aborts the test.

The test should be converted into an integration test. Mocking the GL
library is simply not feasible and not worth the trouble. :/
2021-06-22 16:40:11 +03:00
Vlad Zahorodnii
5d1062f42d autotests: Fix VirtualKeyboardDBusTest
Input method is enabled by default now, adjust the test to that.
2021-06-22 16:28:45 +03:00
Vlad Zahorodnii
c61085dc2e Remove Toplevel::compositing() and Workspace::compositing()
It is error-prone to have multiple sources for the same data. If the
base implementation (Compositor::compositing()) changes, other helpers
can get out of sync.
2021-06-22 08:32:35 +00:00
Vlad Zahorodnii
46b81be246 autotests: Make SceneQPainterTest more robust to BufferInterface changes
At the moment, the test depends on the implicit client connection flush
in BufferInterface::unref(). It will be highly desirable if that connection
flush is gone as it allows us batching wayland events better. It also
allows us remove a system call from a hot path.
2021-06-19 09:24:16 +00:00
Vlad Zahorodnii
b494efb23e autotests: Fix kwinglplatformtest
OpenGL2Compositing enum was replaced with OpenGLCompositing.
2021-06-18 17:31:32 +03:00
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