Commit graph

18508 commits

Author SHA1 Message Date
Vlad Zahorodnii
40dca1c93e Implement window hiding in the WaylandClient class
This change upstreams window hiding functionality from the XdgSurfaceClient
class to the WaylandClient class in order to reduce the amount of duplicated
code in new wayland client sub-classes.
2020-08-18 14:21:41 +00:00
Vlad Zahorodnii
b4b0b93188 qpa: Don't delete platform screens manually
According to the documentation, deleting a platform screen manually can
lead to a crash due to a call to a pure virtual method.
2020-08-18 16:12:43 +03:00
Aleix Pol
c7e5680d63 Hide the keyboard if we type using the physical keyboard 2020-08-18 10:55:21 +00:00
Aleix Pol
b755e6d91b Fix using --scale on kwin_wayland windowed mode 2020-08-18 10:55:21 +00:00
Aleix Pol
3bb829d677 Don't try to reposition the input method client
It already is opinionated about its position.
2020-08-18 10:55:21 +00:00
Aleix Pol
2565e03eb3 Make sure the input methods stay in the unmanaged layer 2020-08-18 10:55:21 +00:00
Aleix Pol
664963c0d6 Kill the input method process when terminating the session 2020-08-18 10:55:21 +00:00
Aleix Pol
f266a7cfa0 Only allow access to zwp_input_* to the input method
It is a very privacy-concerning component, so we will treat it
specifically.
As it is, it will have to come from the --inputmethod argument. We can
work on some UI later on to select which keyboards are available.
2020-08-18 10:55:21 +00:00
Aleix Pol
3733e3e77f Remove embedded implementation of the Virtual Keyboard 2020-08-18 10:55:21 +00:00
Aleix Pol
7aabd45df9 Integrate input-method-unstable-v1 2020-08-18 10:55:21 +00:00
Aleix Pol
494c89a2d9 Introduce AbstractWaylandOutput::geometry 2020-08-18 10:55:21 +00:00
Aleix Pol
062f1c3c87 Let WaylandServer::findOutput tell us about an output given an OutputInterface
Makes for more readable code and allows to reuse the lookup without
adding the boilerplate.
2020-08-18 10:55:21 +00:00
Aleix Pol
2ed00e4afe Move XdgSurfaceClient::updateDepth to WaylandClient
It is strictly related to the surface and this way it can be used from
elsewhere.
2020-08-18 10:55:20 +00:00
Vlad Zahorodnii
2e8f4964ec Drop XdgSurfaceClient::clientGeometry()
It's been superseded by Toplevel::clientGeometry().
2020-08-18 11:43:15 +03:00
Vlad Zahorodnii
811af61e88 Remove unused xdgshellclient.h include 2020-08-17 14:43:59 +03:00
Aleix Pol
be22876348 Don't double-delete Window::handle
It also gets deleted when cleaning up the Workspace.

Found using ASAN.
2020-08-14 16:51:46 +02:00
Aleix Pol
71de41a570 Don't leak screens when cleaning up
Found using ASAN.
2020-08-14 16:50:39 +02:00
Aleix Pol
8de0f8223d Fix compiler warning
No need to copy
2020-08-14 16:50:08 +02:00
Aleix Pol
61ab042d7a Don't leak QTimer
Make sure it's parented so it eventually gets cleaned up.

Found using ASAN.
2020-08-14 16:49:33 +02:00
Aleix Pol
8810bf3408 Remove unneeded includes of QDesktopWidget 2020-08-14 16:48:19 +02:00
Aleix Pol
c176778494 screencast: Enforce an initial window repaint when we start streaming
Notifying a damage will only ensure that the full window is redrawn, but
we need the repaint as well so the painting actually happens.
2020-08-14 09:09:34 +00:00
Méven Car
c6393a936b Screenshot effect: factorize code 2020-08-14 07:59:34 +00:00
Igor Grkavac
3450adf5d1 [tabbox] Fix for Window Switcher
Loop thought the list of modes twice to complete the logic.

BUG: 419654
2020-08-12 19:56:20 +02:00
Vlad Zahorodnii
f237f273da xwayland: Drop unused method
Xwayland::self() is not used anywhere.
2020-08-12 09:59:16 +03:00
Vlad Zahorodnii
e4f2c30f50 xwayland: Use KWIN_SINGLETON to make DataBridge a singleton
For consistency sake, use the KWIN_SINGLETON macro in order to make the
DataBridge class a singleton.
2020-08-12 09:59:13 +03:00
Nicolas Fella
a15966c723 Port away from KMimeTypeTrader
It is about to be deprecated

See https://phabricator.kde.org/T12177
2020-08-12 00:24:23 +02:00
Kai Uwe Broulik
16f74986fb Expose effect ID to scripting via effect.pluginId
This can be used to avoid code duplication by installing an effect multiple
times and tweaking behavior slightly based on the returned ID.

Internally it is called `scriptName` but for consistency with other similar
APIs the name `pluginId` is chosen, and returns e.g. `kwin4_effect_maximize`
2020-08-11 18:50:24 +02:00
Aleix Pol
6f176660fb Fix tests build 2020-08-11 18:18:26 +02:00
Vlad Zahorodnii
8baf535a7a xwayland: Make DataBridge a native event filter
With the DataBridge being a native event filter, we can further separate
DataBridge-specific and generic Xwayland bits. In particular, we no
longer have to call DataBridge::filterEvent() from the dispatchEvents()
method, whose main purpose is to dispatch X11 events to kwin.
2020-08-11 16:12:40 +00:00
Vlad Zahorodnii
c86d3b717a xwayland: Call handleXfixesNotify() directly from Selection 2020-08-11 16:12:40 +00:00
Aleix Pol
17a1640e62 Fix build 2020-08-11 17:35:36 +02:00
Aleix Pol
bd7624fdbf tablet: transform coordinates according to the output transformations
Uses the same code path we use for the mouse and touch, which was added
after the tablet patches.
2020-08-11 13:50:54 +00:00
Aleix Pol
1ad88bdf7c tablet: acknowledge that findTabletSeat might return nullptr
Never hit that case, but I figured it makes sense to account for the
case now since we have several paths that return nullptr.
2020-08-11 13:50:54 +00:00
Xaver Hugl
3a85b57ec2 Send out an additional TabletMove event before TabletPress.
Sometimes when a user puts the pen down too fast a TabletPress event will get triggered before a TabletMove event can occur. The app then assumes the user moved the pen very fast to the new position. The old position is there either (0,0), which often triggers the menu, or the last position the app received, which triggers apps like Xournal++ and Krita to paint a line from the old to the new position.
2020-08-11 13:49:18 +00:00
Aleix Pol
147ee7726e Clean xkb debug output of empty lines
We'd duplicate some \n which made the output more uncomfortable to look
at.
2020-08-11 13:57:13 +02:00
David Redondo
2a9971fa08 Disable AnimationEffects when the screen is locked
BUG:425157
2020-08-10 09:34:15 +00:00
Vlad Zahorodnii
c8433e5194 Add missing contact marker angle brackets 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii
4ce853e8e4 Prettify license headers 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii
1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00
Andrey Butirsky
307a9bc559 Avoid crash in KWin on Session leave
BUG: 420077

- hunk of original commit e8a1f8ecc seems was lost during a94be708e merge,
so restoring it again
- add missing check

Original Differential Revision: https://phabricator.kde.org/D28889
2020-08-06 12:21:03 +00:00
Aleix Pol
d71672a0d1 XdgPopupClient can also be a PlasmaShellSurface
Debugging the panel thumbnails I realised that the setPosition calls
didn't have an effect. This is probably not the only way to fix this bug
but does fix the bug.
At the moment it only brings the position from the interface.
2020-08-06 11:00:43 +00:00
l10n daemon script
d39c9bab2d 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"
2020-08-06 06:03:48 +02:00
Nate Graham
cc862fa674 [focuschain/task switcher] Remove special handling for minimized windows
Right now KWin moves minimized windows to the end of the task switcher's
ordering. However this is a rather confusing and undocumented behavior
that explicitly overrides the user's chosen sort ordering, be it
"Recently used" or "Stacking order". This makes it a hidden magic behavior
of the type that is at risk of being more annoying than useful.

This commit removes the special handling and lets minimized windows live
in the appropriate order in the task switcher.
2020-08-05 14:05:01 +00:00
Andreas Haratzis
159fbc5ec4 Fix clipped shadows on useraction menus, when wayland and desktop scaling is enabled. 2020-08-05 11:54:54 +00:00
Vlad Zahorodnii
51f926c065 Port Xwayland data bridge to xcbutils
This spares a redundant xcb_prefetch_extension_data() during startup.
2020-08-05 08:48:00 +00:00
Vlad Zahorodnii
e7d02ad355 Introduce X11 default screen property in Application
This spares unnecessary looping through all available X11 screens.
2020-08-05 08:48:00 +00:00
Vlad Zahorodnii
7ec93493c9 Stop Xwayland server when X11 connection breaks
There is no point for processing X11 events if the connection has been
shut down due to a fatal error.
2020-08-05 08:48:00 +00:00
Vlad Zahorodnii
5aef9da884 Lower message severity for KWIN_XWL
When the Xwayland process crashes, we will print a warning message, but
that warning message won't show up anywhere in the terminal because the
current message severity for KWIN_XWL is way too high.

This patch lowers the message severity for the KWIN_XWL logging category
so warning messages can be seen from the terminal.
2020-08-05 08:48:00 +00:00
Vlad Zahorodnii
19ad172584 Survive Xwayland crashes
If the Xwayland process crashes, it will bring down the entire session
together with itself. Obviously, we don't want that. At least, Wayland
clients should survive the crash.

This change refactors relevant X11 parts to handle Xwayland crashes in a
less fatal way.

In order to handle Xwayland crashes better, a pair of start() and stop()
methods had been introduced in the Xwayland class to allow starting and
stopping the Xwayland process at any moment.

If we detect that the Xwayland process has crashed, we will immediately
stop the Xwayland server, which in its turn will deactivate the socket
notifier and destroy all connected X11 clients. Unfortunately, a couple
of subtle changes in X11Client::releaseWindow() and Unmanaged::release()
had to be made to ensure that we are left with a valid state after the
Xwayland server has been stopped.
2020-08-05 08:48:00 +00:00
Vlad Zahorodnii
fff2bfe71a Clean up X11 connection setup code
This method removes a code path that we can never hit and fixes some
minor coding style issues.
2020-08-05 08:48:00 +00:00