Commit Graph

18465 Commits (master)

Author SHA1 Message Date
Vlad Zahorodnii 1c61de1990 autotests: Clean up the outputs list when client connection is closed
If the client connection has been closed, the Output::removed() signal
won't be emitted.
2020-08-20 11:56:42 +03:00
Nate Graham ed0b0ee925 [effects/cubeslide] Keep sticky windows on top of the cube by default
This simply looks much better.

BUG: 424550
FIXED-IN: 5.20
2020-08-19 13:31:13 -06:00
Vlad Zahorodnii 9e74199e27 Refactor color scheme related code
Currently, we have two functions that update the color scheme for a
client - updateColorScheme(QString) and updateColorScheme(). Even though
they both share the same name, they do different things. The first one
sets the specified color scheme, while the other determines the color
scheme preferred by the client and assigns it.

This change refactors the color scheme initialization code so we no
longer need those two methods. The setColorScheme() method sets the
specified color scheme, and the preferredColorScheme() method returns
the color scheme preferred by the client. Sub-classes of AbstractClient
can override the preferredColorScheme() method in order to add support
for platform-specific color scheme protocols.

The end result: color scheme related code is a bit more comprehensible.
2020-08-19 15:18:50 +00:00
Aleix Pol eeeac04974 Implement EGL_KHR_partial_update and EGL_EXT_swap_buffers_with_damage
Summary:
Notify the driver about the parts of the screen that will be repainted.
In some cases this can be benefitial. This is especially useful on lima
and panfrost devices (e.g. pinephone, pinebook, pinebook pro).

Test Plan:
Tested on a pinebook pro with a late mesa version.
Basically I implemented it, then it didn't work and I fixed it.
Maybe next step we want to look into our damage algorithm.
2020-08-19 14:51:42 +00:00
Aleix Pol d5da366507 Add a generic Output::transformation method
Makes it possible to map any space into the output's coordinates system
2020-08-19 14:51:42 +00:00
Méven Car 9a8b6f730d Make ScreenShotEffect::screenshotScreen return native screen sized images
Aka not-downscaled images.
CCBUG: 409762
2020-08-19 12:23:39 +02:00
Vlad Zahorodnii eb00a56604 Show a warning message if calling an unimplemented method
It makes easier to spot potential bugs in AbstractClient subclasses.
2020-08-18 21:17:51 +00:00
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