Commit graph

18654 commits

Author SHA1 Message Date
Vlad Zahorodnii
2b241d3081 Properly handle opaque regions for CSD X11 windows
Currently, we don't compute the clip region properly for some client-
side decorated applications, for example gedit, due to mixing several
separate coordinate spaces.

This change ensures that the window pixmap shape and the opaque region
are in the same coordinate space - the window pixmap coordinate.

In order to simplify mapping regions from the window pixmap coordinates
to the global screen coordinates, a new helper method was introduced in
the WindowPixmap class - mapToGlobal().
2020-09-09 15:58:58 +00:00
Vlad Zahorodnii
c0da7faa6f xwayland: Don't exit if failed to read DISPLAY
We want the compositor to survive even if something goes wrong when
starting Xwayland.
2020-09-09 15:25:59 +00:00
Vlad Zahorodnii
8697bcd7e9 xwayland: Avoid printing "FATAL ERROR" log messages
Since we want kwin to survive Xwayland crashes, printing "FATAL ERROR"
is highly undesirable.
2020-09-09 15:25:59 +00:00
Vlad Zahorodnii
b13a74c908 xwayland: Replace criticalError() signal with a less fatal signal
If the Xwayland executable can't be found, the whole session will die
because a criticalError() signal will be emitted.

This change replaces the criticalError() signal with a less severe
signal.

If the errorOccurred() signal has been emitted during the startup
sequence, kwin won't die and will just continue with spawning the
session process.
2020-09-09 15:25:59 +00:00
Vlad Zahorodnii
6dbc060596 autotests: Use new xdg-shell helpers in ToplevelOpenCloseAnimationTest 2020-09-09 15:23:06 +00:00
Vlad Zahorodnii
2691b84c99 autotests: Introduce helper classes for testing xdg-shell clients
After splitting out the server part of KWayland into a separate repo,
all non-core protocol wrappers in KWayland::Client had become obsolete
and using them in new projects is highly discouraged.
2020-09-09 15:23:05 +00:00
Vlad Zahorodnii
fe68ddd9ad Initialize fields of the Workspace class in correct order
The compiler doesn't like that fields of the Workspace class are declared
and initialized in different order.
2020-09-09 14:16:02 +00:00
Vlad Zahorodnii
8a788b71ca Slightly improve code readability
The compiler suggests us to add some parenthesis in order to improve
code readability.
2020-09-09 17:05:34 +03:00
Vlad Zahorodnii
bfb257c9ed kcmkwin/tabbox: Port away from deprecated KTitleWidget::setPixmap()
KTitleWidget::setPixmap(MessageType, ImageAligment) has been deprecated
in favor of KTitleWidget::setIcon() method.
2020-09-09 13:53:26 +00:00
Vlad Zahorodnii
e5dd5b6a77 Replace some if statements with a switch statement
The switch case statement allows the compiler to optimize code. More
specifically, if the values are densely packed, then the compiler may
generate a jump table. The switch statement also looks cleaner.

As for the if statements in adjustWorkArea(), they were overlooked by
me after LayerSurfaceV1Interface::exclusiveEdge() had been introduced.
2020-09-09 13:51:08 +00:00
Vlad Zahorodnii
3805f212ec autotests: Remove XdgShellSurfaceType enum
Currently, it has only one item - XdgShellStable.
2020-09-09 13:21:57 +03:00
l10n daemon script
81a9b824cf 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-09 06:33:22 +02:00
David Edmundson
6acf35e4cc Avoid QPointer in return types of Input methods
QPointer is a really useful way to store a pointer over time.
It doesn't make have any value as a return value used by a short-lived
method.

There isn't a good copy constructor, it's effectively the same as
creating a new QWeakPointer reference that has to be cleaned up.

Testing if something is null is still the same. A new QPointer can be
made by the caller if it actually is needed.

Input handling is a very hot path called many times a frame, so it's
important to keep this light. focus() and at() are called a lot which
added up to slightly over 1% of CPU time when moving the mouse about.
2020-09-08 08:04:13 +00:00
Méven Car
e563b83b43 Make ScreenShotEffet::screenshotScreen return native screen sized images in Wayland case 2020-09-07 10:00:29 +02:00
l10n daemon script
c7d903754f 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-07 06:05:30 +02:00
l10n daemon script
72ab500ece 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-06 05:57:12 +02:00
l10n daemon script
b720b4237b 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-05 06:17:36 +02:00
Vlad Zahorodnii
7e9bec6fd7 Use consistent naming pattern for wayland shell integrations
This change intends to fix a minor inconsistency regarding how shell
integration classes are named.
2020-09-04 16:51:25 +03:00
Vlad Zahorodnii
631276e3c1 Unset virtual keyboard geometry when the input panel surface is unmapped 2020-09-04 13:08:34 +00:00
Vlad Zahorodnii
88829de9dd wayland: Refactor creation of input panel clients
This change introduces a shell integration class for input panel
surfaces. This effectively breaks the direct dependency between our
virtual keyboard component in kwin and the input_panel protocol,
which means that an input method server could use the layer-shell
protocol instead of the input_panel protocol.
2020-09-04 13:08:34 +00:00
Vlad Zahorodnii
b3f3248543 screencast: Switch to new outputScreencastRequested() signal 2020-09-04 08:49:52 +00:00
Vlad Zahorodnii
790ddc0909 Remove WaylandClient::isInputMethod()
We assume that the input method server has at most one surface at a time,
which corresponds to the virtual keyboard. But it's not guaranteed to be
always true.

For example, an xdg_toplevel surface can be created for a configuration
dialog, in which case isInputMethod() should not return true.
2020-09-04 06:47:38 +00:00
Vlad Zahorodnii
33e037d45d Remove InternalClient::isInputMethod()
It's the same as the default implementation.
2020-09-04 06:47:38 +00:00
l10n daemon script
a457bd4310 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-04 06:04:49 +02:00
Vlad Zahorodnii
d3cca65d39 Implement the layer-shell v1 protocol
The layer-shell protocol allows wayland clients to create surfaces that
can be used for building desktop environment components such as panels,
notifications, etc.

The support for the plasma-shell protocol will be dropped once plasma in
all its entirety is ported to the layer-shell protocol.
2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
7be4ab97e4 Move XdgSurfaceClient::cleanTabBox() to WaylandClient
It can be useful for other Wayland clients as well.
2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
e2aaff63f7 Port InputPanelV1Client to WaylandClient's geometry helpers 2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
fde34f3c57 Introduce geometry sync mode flags
The sync mode flags indicate in which fashion position and size update
are made, i.e. synchronous or asynchronous.
2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
7029d9c57c Move XdgSurfaceClient::cleanGrouping() to WaylandClient 2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
085284921a Introduce a property to indicate if client is placeable
The new property indicates if the client can be placed. It can be used
by input-panel or layer-shell clients to opt out from window placement.
2020-09-03 18:11:44 +00:00
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