Commit graph

20517 commits

Author SHA1 Message Date
Vlad Zahorodnii
4459463823 Make focused window and decoration mutually exclusive 2021-12-17 07:19:41 +00:00
Vlad Zahorodnii
41237ea30b Ignore decoration when updating focused window in PointerInput and TouchInput
Currently, it's possible to have the case where the pointer input device
handler or the touch input device handler thinks that there's a focused
window, but the corresponding focused surface in wayland seat is unset,
because the pointer hovers the server side decoration.

If the server side decoration is destroyed, the input device handler will
fail to update wayland seat's focused surface.

In order to make pointer input device handler and touch input device
handler code more intuitive, this change makes focusUpdate() functions
ignore the decoration.

BUG: 411884
BUG: 440380
2021-12-17 07:19:41 +00:00
David Redondo
b1686fd472 Always keep focus on active client when switching activities
While finding this to be benficial when working on the activity
switcher I think it makes sense in general to keep focus on the
current client instead of potentially switching away.
2021-12-16 17:17:27 +00:00
Xaver Hugl
dde7a2efac backends/drm: fix crash with direct scanout
BUG: 447079
2021-12-16 16:44:01 +01:00
Fushan Wen
1d0e75bc5c x11client: Replace activityList with m_activityList
KWin does not update activity status when setting `_KDE_NET_WM_ACTIVITIES`
to nullUuid outside of KWin, which causes "All Activities" not working
as expected for KWindowSystem.

`X11Client::activityList` is not kept in sync with
`AbstractClient::m_activityList`. Move `m_activityList` from private to
protected, and use it in `X11Client::readActivities`

BUG: 440496
2021-12-16 09:59:23 +00:00
Vlad Zahorodnii
34a0813567 wayland: Avoid creating abstract socket for Xwayland on FreeBSD
FreeBSD does not support abstract sockets.
2021-12-16 09:17:28 +00:00
Weng Xuetian
e71fe9ba79 Support text-input-v3 cursor position and position the overlay mode input panel within the screen. 2021-12-16 03:29:00 +00:00
Weng Xuetian
7a270b5d78 Use QPointer to monitor input method server connection.
Input method may crash and leave a dangling pointer. DBus interface may
access the invalid pointer and crash kwin.
2021-12-16 03:29:00 +00:00
Weng Xuetian
d66be7b99f Forward xkb modifier changes to input method.
Since not all the key are forwarded to input method, any modifier
changes need to be forwarded to input method as long as keyboard grab
is active.
2021-12-16 03:29:00 +00:00
Weng Xuetian
11f6292cb5 Move input keyboard filter to be just before the key is sent to application.
Features like global shortcuts should be handled before the input
method.
2021-12-16 03:29:00 +00:00
Weng Xuetian
9e68357ce9 Do not unset DISPLAY and XAUTHORITY for input method.
Those variable are required for XIM to work for Xwayland application.
2021-12-15 17:49:48 +00:00
Vlad Zahorodnii
4bd9708503 autotests: Fix PointerInputTest::testDecoCancelsPopup()
We need to ack configure event that wants to change deco mode.
2021-12-15 17:14:25 +02:00
Vlad Zahorodnii
92317c5eff Remove XdgSurfaceClient::updateGeometryRestoreHack()
It's not defined anywhere.
2021-12-15 15:53:57 +02:00
Vlad Zahorodnii
be32a1b1f5 Move createDecoration() and destroyDecoration() from AbstractClient to InternalClient
They are used only by InternalClient. AbstractClient doesn't need to
handle the destruction of DecorationBridge because its lifetime matches
kwin's lifetime.
2021-12-15 12:47:27 +00:00
Vlad Zahorodnii
acb0683e0d wayland: Properly handle async xdg-decoration updates
Currently, if a window switches between SSD and CSD, it is possible to
encounter a "corrupted" state where the server-side decoration is wrapped
around the window while it still has the client-side decoration.

The xdg-decoration protocol fixes this problem by saying that decoration
updates are bound to xdg_surface configure events.

At the moment, kwin sort of applies decoration updates immediately. With
this change, decoration updates will be done according to the spec.

If the compositor wants to create a decoration, it will send a configure
event and apply the decoration when the configure event is acked by the
client. In order to send the configure event with a good window geometry
size, kwin will create the decoration to query the border size but not
assign it to the client yet. As is, KDecoration api doesn't make
querying the border size ahead of time easy. The decoration plugin can
assign arbitrary border sizes to windows as it pleases it. We could change
that, but it effectively means starting KDecoration3 and setting existing
window deco ecosystem around kwin on fire the second time, that's off the
table.

If the compositor wants to remove the decoration, it will send a
configure event. When the configure event is acked and the surface is
committed, the window decoration will be destroyed.

Sync'ing decoration updates to configure events ensures that we cannot
end up with having both client-side and server-side decoration. It also
helps us to fix a bunch of geometry related issues caused by creating
and destroying the decoration without any surface buffer attached yet.

BUG: 445259
2021-12-15 12:47:27 +00:00
Vlad Zahorodnii
db996e0824 Remove updateDecoration() in AbstractClient 2021-12-15 12:47:27 +00:00
Vlad Zahorodnii
70f46970da Invalidate decoration explicitly
Lets us to remove AbstractClient::updateDecoration().
2021-12-15 12:47:27 +00:00
Vlad Zahorodnii
01a46ff389 Reduce code duplication between X11Client::createDecoration() and AbstractClient::createDecoration() 2021-12-15 12:47:27 +00:00
l10n daemon script
0db88c3ea6 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"
2021-12-15 01:55:28 +00:00
Xaver Hugl
9781f43a48 backends/drm: remove unneeded methods in DrmBackend 2021-12-14 16:31:15 +00:00
Xaver Hugl
5d5bb2422c backends/drm: move definitions into cpp file 2021-12-14 16:31:15 +00:00
Xaver Hugl
ca79f11ede backends/drm: minor refactor of DrmPipeline 2021-12-14 16:31:15 +00:00
Vlad Zahorodnii
991f6b458d Create effects handler after letting toplevels setup compositing
Many effects use the stacking order property of the effects handler in
their constructors. This means that windows should have compositing
setup by the time effects are loaded.

After changing how binary effect plugins are loaded, i.e. not queueing
loading effects, but loading them immediately, some effects broke
because the effects handler is created before windows setup compositing.

This change attempts to fix those effects by rearranging compositor
startup code so windows setup compositing first, then create the effects
pointer.
2021-12-14 15:49:49 +00:00
Vlad Zahorodnii
b26227348c wayland: Move or resize xdg-toplevel window during initialization only if geometry is enforced by a window rule
move() and resize() functions are not convenience helpers around the
moveResize() function. They communicate what kwin wants to see after the
corresponding change is applied. It's needed to make asynchronous
geometry updates work.

This change replaces a moveResize() during XdgToplevelClient
initialization with explicit move() and resize() function calls instead,
so it's more clear what the expected end result is.
2021-12-14 15:19:20 +00:00
jiya dong
fed45422cf fix: Fix the problem of rotating the screen in full-screen state and maximizing the state after exiting full-screen. 2021-12-14 02:13:25 +00:00
Aleix Pol
eaa2f538e3 libinput: Pass QStrings as constref 2021-12-13 18:53:23 +00:00
Aleix Pol
7c6b0d9ef4 libinput: Install org.kde.kwin.InputDevice.xml exposing libinput/device.h
It allows to more comfortably create tooling that implements it.
2021-12-13 18:53:23 +00:00
Aleix Pol
5ff22d7765 libinput: Successfully set the output of a device from the dbus interface 2021-12-13 18:53:23 +00:00
Matt Scheirer
449da861f3 Grammar and syntax changes suggested by @vladz 2021-12-13 18:53:23 +00:00
Matt Scheirer
6287ab16f4 [libinput] Add support for display mapping 2021-12-13 18:53:23 +00:00
Matt Scheirer
e51cefe136 [libinput] Serialize QMatrix4x4 for KConfig 2021-12-13 18:53:23 +00:00
Matt Scheirer
a719ceab4a [libinput] Persist device calibration & orientation 2021-12-13 18:53:23 +00:00
Matt Scheirer
21ef0925ab [libinput] Expose calibration and orientation on devices over dbus 2021-12-13 18:53:23 +00:00
Xaver Hugl
f392a9ba39 backends/drm: add some documentation about the drm api 2021-12-13 16:11:40 +00:00
Vlad Zahorodnii
ec8f4140c3 autotests: Add no border window rule tests 2021-12-13 15:28:54 +00:00
Vlad Zahorodnii
64f2cdf9ed Fix memory leak in some plasma components
A few plasma components cache QSGTexture. Those components rely on
texture references going away with QSGNode users. However, with the
current tear down logic, OffscreenQuickView won't destroy any paint
nodes.

Destroy QQuickRenderControl before QQuickWindow to ensure that are no
paint nodes left alive after OffscreenQuickView.

BUG: 444429
BUG: 444381
BUG: 444077
BUG: 444306
2021-12-13 13:29:56 +00:00
Xaver Hugl
3fb14035cd backends/drm: only use atomic gamma size with AMS
For some reason the property exists with legacy, too. If you try to set
legacy gamma with atomic gamma size it'll fail
2021-12-13 09:23:57 +00:00
Xaver Hugl
58e5a5c9f7 backends/drm: also log properties with legacy
Can be useful to find bugs
2021-12-13 09:23:57 +00:00
Xaver Hugl
4dec21d8e4 backends/drm: remove unused user data 2021-12-13 08:32:33 +00:00
nerdopolis turfwalker
37c3e0d158 Fix crash on simpledrm 2021-12-13 08:02:58 +00:00
Vlad Zahorodnii
09b8f5d838 effects/overview: Animate window icon opacity
This looks better.
2021-12-13 03:53:31 +00:00
Alexander Lohnau
901cc62d28 Remove unused code for loading task switcher KCM
For all the task switchers on my system there is no KCM installed:

```bash
rg 'X-KDE-ParentComponents=(PlasmaXLight|org.kde.breeze.desktop|org.kde.breezedark.desktop|org.kde.breezetwilight.desktop|org.kde.breeze.desktop|org.kde.breezedark.desktop|org.kde.breezetwilight.desktop|org.kde.plasma.mycroft.bigscreen|small_icons|big_icons|compact|text|present_windows|thumbnail_grid|thumbnails|informative)'
```

As the docs state, this is only for buildin effects. Which means it is internal API.
Also I consider the choice of displaying a KCM *or* the preview odd, IMHO the preview
is the most important part.

I stumbled upon this when reviewing the metadata files as part of the preparation
for https://phabricator.kde.org/T14564.

Also this way of plugin loading is discouraged for performance reasons, because all the
plugins from the namespace have to be reopened to get their metadata.
2021-12-11 09:39:55 +01:00
l10n daemon script
92d3345310 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"
2021-12-11 01:41:35 +00:00
Vlad Zahorodnii
1f798485b9 effects/scale: Tune animation params
Use standard easing curves in animations. OutCubic for the intro
animation and the InCubic for the outro animation.

Hidden opacity options were removed because I don't think they are
needed anymore. I made the starting opacity 0.4 to make the animation
look closer to what it would have been with an ease-out curve without
realizing it.
2021-12-10 16:51:54 +02:00
Vlad Zahorodnii
acea685b04 autotests: Replace output management test with a more useful test
The output management test checks the implementation of output
management capabilities in the virtual backend, which is not helpful.

This change replaces it with a more useful test that verifies how
windows are placed after an output change.
2021-12-10 13:06:40 +02:00
Vlad Zahorodnii
ea7779de42 autotests: Fix TestXdgShellClientRules
TestXdgShellClientRules implicitly assumes that the kwinrc config is
referenced only by the RuleBook object.

However, after changing the default placement policy in the
WaylandTestApplication, that's no longer the case. The kwinApp() object
now also holds a reference to the main config file. Because of that,
previous window rules leak to next tests, which breaks them.

In order to address that issue, this change makes TestXdgShellClientRules
open a separate config and wipe it clean after each test run. Not great,
but there doesn't seem to be other way around with current KSharedConfig
api.
2021-12-10 11:21:04 +02:00
Vlad Zahorodnii
eb080395ef backends/drm: Fix stuck cursors
Currently, if you move the cursor really fast between two outputs, there
may be stuck cursor on the previous output.

We need to query the old cursor visibility status before updating the
cursor position, otherwise the drm backend may not schedule an update to
move the cursor offscreen.
2021-12-10 06:24:21 +00:00
Vlad Zahorodnii
f51ad0897f effects/screentransform: Don't read kscreen effect's config
It's fine to have the animation duration hardcoded to 250ms. The main
issue with reading kscreen effect's config is that it adds inter-effect
dependencies, which is simply not worth the trouble.
2021-12-09 20:38:34 +00:00
Vlad Zahorodnii
bdc7ee649b effects/overview: Use out cubic easing curve consistently
The intro and the outro animations are very short and they usually
affect all windows on the screen. Windows have to travel a lot and in
very short time, this doesn't look.

Similar to other windows, this change makes the overview effect use the
out cubic curve for window movements (even though the HIG suggests us
using the InOutCubic easing curve). That way, user will look at
flatter parts of the easing curve more, i.e. the windows would move less
chaotically and simply jump to their target position.

Similar to the WindowHeap, this change makes the overview effect use the
out cubic everywhere else so the intro and the outro animations look
coherent.

Another advantage of the OutCubic easing curve is that it makes the
overview effect look more responsive and subtle.
2021-12-09 17:34:38 +00:00
Xaver Hugl
6ce0cc987d input: set tablet cursor hotspot 2021-12-09 17:09:12 +00:00