Commit Graph

18291 Commits (432cfb44c007accec4ea8c3b0427e09c4962f5aa)

Author SHA1 Message Date
Vlad Zahorodnii 432cfb44c0 xwayland: Restart the Xwayland server after it has crashed
If the Xwayland process has crashed due to some bug, the user should
still be able to start applications in Xwayland mode. There is no reason
to restart the whole session just to be able to launch some application
that doesn't have native support for Wayland.
2020-09-01 06:16:02 +00:00
Vlad Zahorodnii b2792ae3cd effects/slidingpopups: Properly clip windows
The region that we pass to the next paintWindow() cannot be larger than
the one that we've received. If an effect passes a larger region, the
tracked buffer damage will be messed up and user will see all sorts of
visual artifacts.
2020-09-01 06:12:39 +00:00
Vlad Zahorodnii ed113171f3 effects: Disable blur and contrast effect when screen is locked
The results of the blur and the background contrast effect will never
be seen if the screen locker is active.

In order to avoid wasting computational resources, we could temporarily
disable the blur effect until the screen is unlocked.

Furthermore, given that the blur effect shrinks the clip region, it is
guaranteed that the compositor will have to render the desktop window
behind the lockscreen window. With this change, all windows behind the
screen locker will be properly clipped away.
2020-09-01 06:12:01 +00:00
Laurent Montel 87ff6e4b44 Port away from deprecated Qt::MidButton 2020-09-01 07:14:58 +02:00
Vlad Zahorodnii afdd5b84c7 effects/blur: Remove leftovers after blur cache
The original purpose of m_damageArea was to indicate which region of the
blur cache became dirty and needs to be updated. However, we no longer
need to keep track of damaged area since the blur cache was removed.
2020-08-31 23:14:14 +03:00
Alexander Lohnau 0d3c20d386 Clear plugins after changing KNS entires
BUG: 382136
FIXED-IN: 5.20
2020-08-31 06:35:42 +00:00
Nate Graham 5ba3793cf9 [kcmkwin/kwinoptions] Add option to disable window position memory for KDE apps
This adds a setting to the window options KCM to disable KDE apps
remembering their own window positions on X11, and instead always use
the KWin placement modes.

The setting sets an option in `kdeglobals`, rather than kwinrc, as it is not
a KWin-specific option *per se*. The UI is also hidden on Wayland, as it it
not relevant there because the functionality it disables does not work on
Wayland. Instead, remembering window positions will eventually be implemented
in a different way and affect all windows, not just KDE windows.

See https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/14 for
more details.

CCBUG: 415150
2020-08-28 16:43:51 +00:00
Alexander Lohnau 4e481d0e66 Add uninstall button for kwin scripts
BUG: 315829
FIXED-IN: 5.20
2020-08-28 15:32:44 +00:00
Alexander Lohnau bde274eb70 Fix KNS deprecations 2020-08-28 15:22:17 +02:00
Vlad Zahorodnii 472b5e7f9e autotests: Fix the license header in a test 2020-08-28 11:11:09 +03:00
Alexander Lohnau b73db9fd6b Port knsrc file to explicit syntax for kpackage 2020-08-27 08:41:10 +00:00
Adrien Faveraux 788c65d260 Fix Build Warning 2020-08-26 19:24:02 +02:00
Vlad Zahorodnii d97f12c1c6 wayland: Expose tiled state to xdg-shell clients
A client-side decorated window could use this information to improve
management of edges, for example by providing inset resize handles, etc.
2020-08-24 20:49:40 +03:00
Vlad Zahorodnii 0dda9dc7d0 Use namespace kwin only in autotests
In kwin core, we prefer not to put `using namespace KWin` because it
makes defining forward declared classes more trickier.
2020-08-21 22:06:36 +00:00
Méven Car 571ca776c3 Screenshot effect: Convert a couple foreach loops 2020-08-21 16:33:32 +00:00
Nicolas Fella fb118a9343 Expose the toplevel's pid in the scripting API
This allows scripts to obtain the process behind a window, which can be useful for doing app-specific things in a script.
2020-08-21 15:44:52 +02:00
Vlad Zahorodnii 90b53f416c Use universal helper for writing toplevels to QDebug streams
Toplevel::debug() is one of annoyances that you need to deal with when
implementing a new client type. It can be tempting to just write "this"
to the stream, but it will result in a crash.

In order to make implementing new client types easier, this change
introduces a debug stream insertion operator overload that works for all
kinds of the Toplevel class.
2020-08-21 11:42:53 +00:00
Vlad Zahorodnii 29afd62e9c Evaluate window rules only if they are supported
There is no point for evaluating window rules for popups and internal
clients.
2020-08-21 11:42:17 +00:00
l10n daemon script 72eb1153db 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-21 06:15:23 +02:00
Vlad Zahorodnii 3e9b722f8c Explicitly indicate support for window rules
This way it's more difficult to overlook the case where a new client
type unexpectedly advertises that it supports window rules.
2020-08-20 16:18:59 +00:00
Andrey Butirsky cba895e723 fix: keyboard layout applet doesn't show actual layout
BUG: 425343
2020-08-20 16:09:43 +00:00
Vlad Zahorodnii 925bb4eea3 Adapt to XdgOutputManagerV1 changes 2020-08-20 17:53:10 +03:00
Vlad Zahorodnii 05e62f5559 Don't override irrelevant methods in InputPanelV1Client 2020-08-20 13:56:42 +03:00
Vlad Zahorodnii 9a04442781 Add default handler for screen edge based activation
This change adds a default handle for screen edge based activation in
order to reduce the amount of boilerplate in client sub-classes that do
not support features such as auto-hiding, e.g. popups.
2020-08-20 12:49:59 +03:00
Vlad Zahorodnii b36b3c67d1 Provide default implementation for noborder functionality
This change adds a default implementation for no border functionality
in order to reduce the amount of boilerplate code in client sub-classes
that have no support for server-side decorations.
2020-08-20 12:49:57 +03:00
Vlad Zahorodnii 74da0bb701 Provide default implementation for AbstractClient::updateDecoration()
Not all client types support server-side decorations, for example it's
typically the case for popup windows. This change provides a default
implementation for the updateDecoration() method in order to reduce the
amount of boilerplate code in client types that have no support for ssd.
2020-08-20 12:48:00 +03:00
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