Commit graph

18246 commits

Author SHA1 Message Date
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
Vlad Zahorodnii
707a02071e Add a simple test to check Xwayland dying
The new test verifies that we handle Xwayland crashes gracefully.
2020-08-05 08:48:00 +00:00
Xaver Hugl
40b52eb4a4 Discard sub-pixel movements in gestures
On some touch devices the screen edges sometimes don't work because it detects a 0.5px movement up or down, and that cancels the swipe gesture. This patch discards sub-pixel movements for gestures to fix that.

BUG: 423842
BUG: 421212
2020-08-04 13:52:16 +00:00
Niccolò Venerandi
e41c5af676 Expose transientFor and only blur underneath when transientParent is dock 2020-08-02 10:25:28 +00:00
Aleix Pol
d4cd2b5a6a Account for OpenGLWindow::windowPixmap returning nullptr sometimes 2020-07-31 19:49:15 +02:00
David Edmundson
405841caf2 Install service files for kwin 2020-07-30 15:02:08 +01:00
Vlad Zahorodnii
d4ec18d844 Fix build 2020-07-29 15:35:50 +03:00
Vlad Zahorodnii
678944ceb8 xwayland: Remove mysterious Q_FALLTHROUGH macros
We cannot fall through to the next case because `reinterpret_cast`ing
incompatible events is dangerous.
2020-07-29 12:11:57 +00:00
Chaojiang Luo
def9817a7e fix:Check image map nullptr error
The map may be failed, we should check the image map is succeed first.

Signed-off-by: luochaojiang <luochaojiang@uniontech.com>
2020-07-29 12:11:17 +00:00
Xaver Hugl
901a9a2373 make the panelAutoHideHideRequested callback also handle panels set to "windows can cover" 2020-07-29 11:25:43 +00:00
Aleix Pol
03b12d1dfc drm: Use introspection to print enums
Removes a bit of code and allows to list the supported
transformations on the same line, which is useful to be able to
grep over the output.
2020-07-29 10:39:47 +00:00
Vlad Zahorodnii
a7b922bfce screencast: Don't include platformsupport headers
These headers are meant to be used only by platform and scene plugins.
2020-07-28 21:50:26 +03:00
Vlad Zahorodnii
2103b999e7 screencast: Address minor issues 2020-07-28 18:38:49 +00:00