Summary:
The functionality regarding triggering modifier only shortcuts is moved
out of Xkb - where it doesn't belong to - and is turned into an input
event spy listening for the changes it is interested in. Previously
the state got queried by asking e.g. for the pressed buttons, now it's
tracked directly.
The X11 side needs a larger change due to that as now pushing the events
into Xkb does not trigger modifier only shortcuts any more. Instead the
"normal" way through the platform API needs to be used which triggers the
processing of filters and spies.
The problem here is that our redirections only process events if they are
inited and that only happens on Wayland. We cannot call init on them as
that would create all the Wayland filters and spies and processing would
probably break. As an intermediate solution the spies are now processed
and there we know that it won't matter. A future solution would be to
remove the init checks completely and just send through both filters and
spies and ensure that on X11 only the supported ones are loaded.
Closes T5220
Test Plan: Tested on Wayland and X11
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Maniphest Tasks: T5220
Differential Revision: https://phabricator.kde.org/D4578
Summary:
It doesn't make much sense to export the DBus service if there is nothing
one can do with it.
Test Plan: Added test case
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4562
Summary:
As described in https://bugreports.qt.io/browse/QTBUG-57714 exposing a
QWidget as a context item to QtQuick can crash. Especially as the
engine's context property gets deleted whilst deleting the parent item.
This patch reworks the code so that the models are exposed to QML
directly rather than going through a QWidget.
CCBUG: 373628
Test Plan:
Pressing back whilst in the decoration KCM used to crash every time, now it doesn't.
I still have the buttons.
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, cfeck, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4533
Summary:
This replaces the previous solution to require at least gcc 4.8 which
did not cover clang. As cmake has a proper way to check for 11, let's
use that.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4486
Summary:
Increases minimum Qt version to 5.7. This allows to drop the pre-5.7
virtual keyboard and various ifdefs for now unsupported versions.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4485
Summary:
So far KWin did not support the sequence:
1. Create wl_shell
2. Create PlasmaShellSurface
3. Create wl_shell_surface
KWin only supported the case that the PlasmaShellSurface is the last
thing to get created. This is rather limiting and can be considered a
bug. At least we had a QEXPECT_FAIL auto test for this situation. So
it was a known issue.
This change should make it easier to support the QtWayland changes in
Qt 5.8.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4482
Summary:
Unfortunately Xkb does not emit a signal when the keyboard layout
changes. Due to that we need to manually check in KeyboardLayout after
each action which could change the layout whether the layout changed.
This was not yet done for the case when the layout got changed through
the DBus interface. Resulting in the DBus signal not emitted.
This change addresses the issue by invoking the check for change after
changing the keyboard layout.
Test Plan: Added test case
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4387
Summary:
This change introduces a new class KeyboardLayoutDBusInterface which
implements the same DBus interface as the keyboard kded module.
Thus components which interact with the keyboard kded through dbus start
to also work on Wayland.
Together with D4322 this should result in keyboard layout being available
on the lock screen.
T5209
Test Plan:
Tested with qdbusviewer: switching layout works, signal on
change gets emitted.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4323
Summary:
So far KWin parsed the kxbkrc at multiple places (once in Xkb, once
in KeyboardLayout). This is now replaced by one KSharedConfigPtr hold
by kwinApp, just like the normal kwinrc. The KSharedConfigPtr is now
passed to Xkb.
As a nice side effect this makes it easier to test keyboard layout
changes as we can now properly mock the keyboard configuration. Thus
this change also comes with an autotest for loading keyboard layout
configuration. This is becoming more and more a need as we start
getting bug reports for layout specific issues like global shortcuts
not working with Greek layout.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4315
Summary:
So far on a geometry sync we did not call performMoveResize like we
do on X11 when getting the sync. This resulted in the
clientStepUserMovedResized not getting called during resize and the
geometry update effect to not function.
BUG: 374869
FIXED-IN: 5.9.1
Test Plan: Geometry hint updates
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4333
During resize the signal clientStepUserMovedResized signal is not emitted
for Wayland windows which causes the window geometry effect to not
function. This change adds a test case highlighting the problem.
Summary:
So far the keyboard repeat handling was triggered directly from
KeyboardInputRedirection::processKey. With the introduction of
InputEventSpies it is no longer required to be done like that, we can
split it out into a dedicated spy.
This means that processKey only has to care about processing the key
and allows us to better extend in future. So far keyboard repeat is
only functional for libinput based platforms. But it should also be
possible to use it in nested setups. By splitting it out we can
prepare for that.
Test Plan: Auto-test using repeat still passes
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4304
Summary:
We don't want a context-menu entry to quit KWin.
T5168
Test Plan: No more context menu shown.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4299
Instead of having an expect fail on every check for the count of signals
emitted for clientStepUserMovedResized we reset after the first one which
is the actual issue.
Thus we can properly check that in the other cases the signals are
emitted.
Summary:
Our keyboard layout kcm allows to set a global shortcut to switch to a
specific keyboard layout. So far KWin/Wayland did not support those
shortcuts, only the switch to next layout shortcut was supported.
This change introduces support for custom layout shortcuts. For that
we iterate over all available layouts and check whether a shortcut is
registered. If that is the case a QAction is created and passed to
KGlobalAccel.
As the triggering code is similar to the menu, the switchLayout lambda
is split out into a dedicated method and translating the layouts is
extracted into a method.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4256
Summary:
On X11 the SNI for keyboard layout is provided by the keyboard kded.
On Wayland that kded has no real access to the layouts and cannot
properly implement switching. Given that it's better to integrate the
SNI directly in KWin.
The implementation of the SNI is largly based on the existing SNI from
plasma-desktop/kcms/keyboard. The implementation so far supports:
* Switching to next layout on toggle
* Presenting all layouts in a context menu
* Switching to a specific layout through the context menu
* Opening the keyboard layout configuration module
* scroll on SNI to switch layout
* config option whether to show the SNI
Not yet supported are:
* flags and/or short text for the layouts
The last point needs more explanation. On X11 the layout name is
something like "de" or "us". This can be directly mapped to a flag and
can be added as a short note.
Xkbcommon does not provide this information directly. Instead it provides
us the full name of the layout, e.g. "German" or "English (us)". There is
no way in the API to go from "German" to "de".
Instead we need to parse the evdev.xml file to gather all information
about layouts. This is already done in the keyboard kcm to configure
layouts. The implementation needs to be split out into a small helper
library.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4220
Summary:
If a Wayland window is decorated the decoration size was not considered
when passing touch points to the Wayland window. For pointer input this
is considered and implemented through the input transformation matrix
which KWayland::Server::SeatInterface accepts. This should also be done
for Touch. Unfortunately the frameworks version for Plasma 5.9 is already
tagged and done and we cannot depend on new API.
Thus this change tries to workaround by calculating the proper offset
through the input transformation matrix. It isn't nice but fixes the
problem for now.
BUG: 374778
Test Plan: Only in unit test, real test still missing
Reviewers: #plasma_on_wayland, #kwin
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4074
Summary:
This change adds support for marking the OnScreenMessage as it should
skip close animation. The screenshot effect is adjusted to use the
on screen message instead of the custom effect frame.
Test Plan: Message window is not captured when taking screenshot
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4091
Summary:
So far we didn't trigger modifier-only-shortcuts when capslock was
enabled. In fact we even ensured that the shortcuts did not trigger.
This seems not to be what our users expect. Meta should still trigger
if capslock is on.
This change modifies the logic to determine which modifier is currently
pressed by using the modifiersRelevantForGlobalShortcuts. The difference
to the "normal" modifiers is that this excludes capslock from modifiers
and excludes consumed modifiers. The latter is not really relevant as
modifier-only-shortcuts do not trigger if multiple keys are pressed,
which is required to have a modifier consumed.
BUG: 375355
FIXED-IN: 5.8.6
Test Plan: Only with adjusted autotest
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4241