Commit graph

15126 commits

Author SHA1 Message Date
Martin Gräßlin
58f26b8f55 Split KWin::Xkb into a dedicated .h and .cpp
Summary: Closes T5221

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Maniphest Tasks: T5221

Differential Revision: https://phabricator.kde.org/D4623
2017-02-15 17:48:55 +01:00
Martin Gräßlin
65ddd32d1a Split modifier only handling into a dedicated InputEventSpy
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
2017-02-14 17:02:18 +01:00
Martin Gräßlin
cf79de5f36 Merge branch 'Plasma/5.9' 2017-02-14 07:37:00 +01:00
Martin Gräßlin
8b4f284249 [autotests] Add test case for quick tiling on X11
Exposes our regressions of X11 quick tiling when a window is vertically
maximized.

CCBUG: 376155
2017-02-14 07:29:38 +01:00
l10n daemon script
26339e6d6c 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"
2017-02-13 05:52:41 +01:00
l10n daemon script
e9155286e8 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"
2017-02-12 07:29:42 +01:00
l10n daemon script
56767ad31a 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"
2017-02-12 05:49:00 +01:00
Martin Gräßlin
40de5fa75f Only export the org.kde.keyboard DBus service if there are at least two layouts
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
2017-02-11 11:37:45 +01:00
Martin Gräßlin
df76d83087 [autotests] Add test case for per-keyboard-layout global shortcut
This new test method verifies that the global shortcut functionality
to switch to a specific layout functions correctly.
2017-02-11 09:46:33 +01:00
David Edmundson
29179f115c Avoid a crash on Kwin decoration KCM teardown
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
2017-02-10 10:52:48 +01:00
l10n daemon script
c2bc7d4d04 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"
2017-02-10 07:31:10 +01:00
Martin Gräßlin
94f8011914 Merge branch 'Plasma/5.9' 2017-02-07 22:06:57 +01:00
Martin Gräßlin
1a9ece7cd4 Require C++11 through cmake
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
2017-02-07 21:28:51 +01:00
Martin Gräßlin
16647c3a3c Require Qt 5.7 and remove pre-5.7 code
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
2017-02-07 20:43:19 +01:00
Martin Gräßlin
8edd0336e6 Support creation of PlasmaShellSurface prior to ShellSurface
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
2017-02-07 19:26:36 +01:00
Jonathan Riddell
41bd8d0de9 Update version number for 5.9.1
GIT_SILENT
2017-02-07 11:09:59 +00:00
Jonathan Riddell
0fcbf4bafb Merge Plasma/5.9 into master 2017-02-07 10:06:34 +00:00
Martin Gräßlin
b16bd4147a Ensure the layoutChanged DBus signal gets emitted when changing layouts through DBus
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
2017-02-06 19:36:30 +01:00
l10n daemon script
150a7bc50b 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"
2017-02-05 07:52:17 +01:00
l10n daemon script
8484a2a3a0 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"
2017-02-04 06:28:40 +01:00
l10n daemon script
d886ea9004 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"
2017-02-03 08:02:50 +01:00
l10n daemon script
1296cfd861 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"
2017-02-03 06:18:14 +01:00
Martin Gräßlin
d33c96af5e [autotests] Add test case for changing keyboard layout through DBus
Calls setLayout of org.kde.KeyboardLayouts.
2017-01-31 19:42:55 +01:00
Martin Gräßlin
551d4a8a5d Implement the DBus org.kde.KeyboardLayouts interface of keyboard kded
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
2017-01-30 17:04:27 +01:00
Martin Gräßlin
8d9c4acf4d Provide kxbk config through kwinApp
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
2017-01-30 17:04:03 +01:00
Martin Gräßlin
c35aae2c4f Merge branch 'Plasma/5.9' 2017-01-30 17:03:46 +01:00
Martin Gräßlin
5083adb1b8 Call performMoveResize when we got a new geoemtry during resize
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
2017-01-30 17:02:13 +01:00
l10n daemon script
74ec881d6a 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"
2017-01-30 07:42:23 +01:00
l10n daemon script
4b5cd32849 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"
2017-01-30 06:04:34 +01:00
Martin Gräßlin
3088b50ad4 Merge branch 'Plasma/5.9' 2017-01-29 14:03:51 +01:00
Martin Gräßlin
a67f4dfa65 [autotests] Add test case for resizing window manually
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.
2017-01-29 14:01:15 +01:00
l10n daemon script
6cd42c9227 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"
2017-01-28 08:15:46 +01:00
l10n daemon script
4bdf3af962 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"
2017-01-28 06:37:05 +01:00
Martin Gräßlin
eb92477210 Split Keyboard Repeat handling into a dedicated InputEventSpy
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
2017-01-27 16:03:37 +01:00
Martin Gräßlin
b636feb8eb Disable standard actions on VirtualKeyboard SNI
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
2017-01-27 16:03:11 +01:00
Martin Gräßlin
de444194ed Improve MoveResizeWindowTest::testMove expected fail cases
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.
2017-01-26 20:41:58 +01:00
Martin Gräßlin
6b0b4cf468 Support global shortcut to switch to specific layout
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
2017-01-26 18:50:49 +01:00
Jonathan Riddell
7e54ec82a4 Update version number for 5.9.0
GIT_SILENT
2017-01-26 11:06:39 +00:00
l10n daemon script
cbaaf3be5a 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"
2017-01-26 07:35:52 +01:00
l10n daemon script
997af81ea9 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"
2017-01-26 05:57:24 +01:00
Martin Gräßlin
fe561c5c7d Add a basic SNI for keyboard layout
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
2017-01-25 14:00:23 +01:00
Martin Gräßlin
1173f190bc Merge branch 'Plasma/5.9' 2017-01-25 13:59:39 +01:00
Martin Gräßlin
7e89c51823 Add workaround for touch input offset for decorated windows
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
2017-01-25 13:58:28 +01:00
Martin Gräßlin
d38bce776f Add support for skip close animation to OnScreenMessage
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
2017-01-25 13:54:34 +01:00
Martin Gräßlin
31405ae10f Merge branch 'Plasma/5.8' into Plasma/5.9 2017-01-25 13:40:02 +01:00
Martin Gräßlin
5a87fa3f92 Support modifier-only-shortcuts when capslock is on
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
2017-01-25 13:39:04 +01:00
l10n daemon script
a1a6341158 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"
2017-01-25 07:33:24 +01:00
l10n daemon script
a18f055779 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"
2017-01-25 05:59:29 +01:00
l10n daemon script
6fae26cc25 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"
2017-01-24 14:28:34 +01:00
l10n daemon script
d9e7498593 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"
2017-01-24 12:53:38 +01:00