Commit graph

18304 commits

Author SHA1 Message Date
Vlad Zahorodnii
b8a16d4abf xwayland: Properly handle xcb_connect_to_fd() failures
xcb_connect_to_fd() will never return a NULL pointer, even if an error
has occurred.

Right after creating an xcb connection, xcb_connection_has_error() needs
to be called in order to determine if the connection has an error.
2020-09-02 12:49:44 +00:00
Vlad Zahorodnii
bfcf312e37 Drop unused libwayland-cursor dependency
KWin doesn't need libwayland-cursor since cb7a9456c0.
2020-09-02 14:37:27 +03:00
Aleix Pol
f5a75e70dc Fix ASAN warning
Don't leak the MockWorkspace, no other test does.
2020-09-02 13:13:33 +02:00
Aleix Pol
2d1f276c2c Fix warning
Don't include the moc of a file without Q_OBJECT
2020-09-02 13:13:33 +02:00
Vlad Zahorodnii
12e428bd33 plugins/windowsystem: Adjust installation path
${PLUGIN_INSTALL_DIR}/kf5/org.kde.kwindowsystem.platforms/ is now an
obsolete installation destination for KWindowSystem platform plugins.
2020-09-01 22:44:11 +03:00
Vlad Zahorodnii
889814a8cc Fix a typo 2020-09-01 20:21:17 +03:00
Aleix Pol
9750a38069 test: add test for edges on mostly overlapping outputs
Inspired in commit b2a44fb08aa140646c879226ee82509aa201ec11 by Roman
Gilg <subdiff@gmail.com> in kwinft.
2020-09-01 14:39:36 +00:00
Roman Gilg
001761cea2 fix(space): check edges for nearly complete screen overlap
When two outputs are positioned on top of each other in a way that one covers
most of the height or width of the onter one with exception of a small gap this
gap might be too small to later on substract the orner offset and stay
positive. In this case do not create the edge at all.

The screen edges test passes again.
2020-09-01 14:39:36 +00:00
David Edmundson
8303a4cdf8 Make GL Context current when deleting lanczos textures in timer hander.
A timer could have fired at any time. We process mulitple QtQuickViews
on timers which change the GL context.

Deleting a kwin GLTexture calls glDeleteTextures/glDeleteFramebuffers.

Surprisingly I haven't seen a crash report from this, but it doesn't
look right.
2020-09-01 09:13:00 +00:00
Nicolas Fella
0f588c256c Drop empty X-KDE-PluginInfo-Depends
The whole concept is almost unused and there's no point in having it there but empty

See also https://phabricator.kde.org/T13553
2020-09-01 09:11:48 +00:00
Marco Martin
97f4712f29 Fix size restore upon keyboard close in XdgSurfaceClient
in XdgSurfaceClient setFrameGeometry is async,
so we can't rely on it having the final value immediately.
make setVirtualKeyboardGeometry a virtual.
in the implementation on setVirtualKeyboardGeometry
use requestedFrameGeometry() instead of frameGeometry()
2020-09-01 08:58:46 +00:00
Vlad Zahorodnii
f894976e2e xwayland: Don't start Xwayland if it's already running
If the Xwayland server is being started or has already been started, do
nothing in the start() function. Normally, we would never encounter such
situation, but if we do, this check will be very useful in preventing
hitting undefined behavior in the compositor.
2020-09-01 09:39:00 +03:00
Vlad Zahorodnii
a6ff3001c8 xwayland: Send a notification when Xwayland crashes
Send a notification when Xwayland crashes to provide the user some
feedback regarding why all X11 clients have disappeared.
2020-09-01 06:16:02 +00:00
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