Commit graph

18324 commits

Author SHA1 Message Date
Vlad Zahorodnii
578d34dba9 Introduce Platform::findOutput(int) overload
This can be useful if there is a need to look up an output by id.
2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
6cfee149ea Move AbstractWaylandOutput::geometryChanged() to AbstractOutput
On X11, this signal is never emitted because outputs get destroyed when
the output layout changes.
2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
4296a38a30 Move geometry handling code from XdgSurfaceClient to WaylandClient 2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
a9fd5ac19f Move struts logic to AbstractClient 2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
4b978bb403 wayland: Switch to generic xdg_popup parent property 2020-09-03 18:11:44 +00:00
Bhushan Shah
e900dc3b5e qpa: remove unused override for the inputcontext
Previously qtvirtualkeyboard was integrated weirdly so that it was
acting as the focus object and proxy for input methods, however now that
we support proper input methods, this code is totally unused in the QPA
and actually prevents the QT_IM_MODULE from working now that
qtvirtualkeyboard is dropped.

See: f26f2fe181 for the reference of the
code deleted.
2020-09-03 12:29:57 +00:00
Vlad Zahorodnii
29a960c399 Set the skip switcher flag for InputPanelV1Client surfaces
Set the skip switcher flag to indicate that input panel surfaces do not
show up in the tabbox.
2020-09-03 10:34:16 +00:00
Vlad Zahorodnii
d71a8ed337 Don't set keep above state for InputPanelV1Client
Input panel clients are placed in the unmanaged layer, so there is no
point for setting the keep above state.
2020-09-03 10:34:16 +00:00
Bhushan Shah
31e881d0e4 virtualkeyboard: close keyboard when focused text input goes away
Currently when focused text input goes away due to either crash or
explicit user action, keyboard leaves hanging, instead close it up.
2020-09-03 09:52:25 +00:00
Aleix Pol
b2f30e7d7d testScreenEdges: no need to wait twice for Screens::changed
Now ::init does it and we don't need to account for it from test cases
2020-09-03 11:23:06 +02:00
Bhushan Shah
9fc09b9a32 virtualkeyboard: update the input panel state when textinput requests it
v1, v2 and v3 protocols supports the update/commit state methods for the
text-input protocol, use it to commit the input method state
2020-09-03 09:08:54 +00:00
Bhushan Shah
f93af91327 virtualkeyboard: remove unused event overrides
Previously qtvirtualkeyboard was integrated weirdly so that it was
acting as the focus object and proxy for input methods, however now that
we support proper input methods, this code is totally unused and it is
confusing to have it here, so just drop it

See: f26f2fe181 for the reference of the
code deleted.
2020-09-03 09:08:54 +00:00
Bhushan Shah
97c0270cd3 Send surroundingText and content hints/purpose to inputmethod
Previously we were either sending out this information to InputMethod of
the QApp (i.e kwin itself) which is no longer case since we switched to
using the proper wayland protocol instead of the qtvirtualkeyboard
inside the kwin.

This fixes the issue with the weston-keyboard at least that in field
which accepts digits it shows the keyboard with digit layout. I still
have some issues with maliit-keyboard but that might be bug on the
maliit-keyboard side.
2020-09-03 09:08:54 +00:00
l10n daemon script
3c756a44d1 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-09-03 06:07:27 +02:00
Vlad Zahorodnii
848f7f3177 Revert "plugins/drm: Link against Wayland::Server"
This reverts commit efb9e0edb2.

libwayland-server is now in the link interface of kwayland-server.
2020-09-02 19:31:29 +03:00
Vlad Zahorodnii
efb9e0edb2 plugins/drm: Link against Wayland::Server
We need to link against Wayland::Server because the EGL Streams protocol
wrapper uses wl_array in its public API.
2020-09-02 16:10:25 +00:00
Aleix Pol
5903c5be09 Fix testScreenEdges for good
Don't call kwinApp, because we are not on one.
The correct way to mock the geometries is by using the MockScreens,
which is already used in this test.
2020-09-02 18:05:53 +02:00
Aleix Pol
6d59c0b4e5 Small TestScreenEdges simplification 2020-09-02 15:15:03 +02:00
Aleix Pol
b92b0b0a7c Fix testScreenEdges test with ASAN
Removes unnecessary check
2020-09-02 15:15:03 +02:00
Vlad Zahorodnii
f55ae15788 Remove unused wayland-cursor.h includes 2020-09-02 15:59:36 +03:00
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