Commit Graph

156 Commits (0b47b84816acff5a2a493db3aab5aff52c6cc5dd)

Author SHA1 Message Date
Martin Gräßlin 0b47b84816 Ignore non-relevant modifiers when evaluating mouse actions
Summary:
E.g. CapsLock should not prevent Alt+left click move.

BUG: 372809

Reviewers: #kwin, #plasma_on_wayland, broulik

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3467
2016-11-25 07:37:58 +01:00
Martin Gräßlin af56c6b050 Implement interactive window selection for Wayland platforms
Summary:
The interactive window selection is implemented in InputRedirection
through a dedicated InputEventFilter. The InputEventFilter so far takes
care of pointer input and keyboard input. In addition it ensures that
keyboard and pointer focus is reset on start and on end.

With this change KillWindow now also works on Wayland, but only for X11
windows, as the Wayland variant is not yet implemented.

Test Plan: Tested in nested setup, auto-tests still needed

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3365
2016-11-17 14:06:42 +01:00
Martin Gräßlin fd83366e31 Implement interactive window selection for Wayland platforms
Summary:
The interactive window selection is implemented in InputRedirection
through a dedicated InputEventFilter. The InputEventFilter so far takes
care of pointer input and keyboard input. In addition it ensures that
keyboard and pointer focus is reset on start and on end.

With this change KillWindow now also works on Wayland, but only for X11
windows, as the Wayland variant is not yet implemented.

Test Plan: Tested in nested setup, auto-tests still needed

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3365
2016-11-17 09:42:12 +01:00
Martin Gräßlin b6af777230 Forward pointer gestures to Wayland server
Summary:
This change implements forwarding the pointer gestures to the new API in
SeatInterface.

While screen is locked no gestures are forwarded to the server. Also
locking the screen cancels any active gesture. Similar if areas inside
KWin would start to intercept the gestures, they need to be cancelled on
the Wayland SeatInterface.

Test Plan: Not yet

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3174
2016-11-07 13:45:08 +01:00
Martin Gräßlin f17d06ee7d Merge branch 'Plasma/5.8' 2016-11-04 10:03:10 +01:00
Martin Gräßlin da0ba76324 Invert the scroll direction for wheel events on internal windows
Summary:
For whatever reason Qt scrolled the wrong way on internal windows. As a
new QWheelEvent is constructed anyway, just multiply by -1 to get the
direction fixed.

BUG: 371999
FIXED-IN: 5.8.4

Test Plan: Tried debug console in nested setup, scrolled correctly now.

Reviewers: #kwin, #plasma_on_wayland, broulik

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3247
2016-11-04 09:00:10 +01:00
Martin Gräßlin 9eede1c66b Merge branch 'Plasma/5.8' 2016-10-17 08:59:35 +02:00
Martin Gräßlin 4c7752c965 Support LEDs in Xkb and libinput
Summary:
The Xkb implementation starts to track the state of the LEDs in the
keymap and emits a signal whenever the LEDs change. This signal is
connected to a method in LibInput::Connection which updates the led
state on all devices and uses it to init the state of the led when a new
device gets connected.

BUG: 369214
FIXED-IN: 5.8.2

Test Plan: Connected a keyboard with LEDs and enabled NumLock and ScrollLock.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2943
2016-10-17 08:01:49 +02:00
Martin Gräßlin cc2f4e3240 Support for relative pointer motion events
Summary:
If KWin interacts with Libinput the RelativePointerManager interface
gets created on the Wayland server. The ForwardInputEventFilter does
forward the relative motion events in addition to the normal motion
events.

In order to properly support the relative motion events as they are
expected by the Wayland protocol the handling of pointer motion events
got slightly adjusted:
* Libinput Pointer event extended by the additional data points
* Libinput Pointer event carries the delta as a QSizeF instead of
QPointF
* PointerInputRedirection adjusted to take a pointer motion event with
more arguments
* Custom QMouseEvent subclass adjusted to carry the additional members

The DebugConsole is adjusted to show the relative motion events in
addition to the global position.

Test Plan:
Verified the manager object is created and verified the
events in DebugConsole. Unfortunately not aware of any test application.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2979
2016-10-12 11:26:46 +02:00
Martin Gräßlin fb59b05488 Add support for resize only borders on Wayland
Summary:
This change adds support for resizing outside the window decoration
(e.g. setting borders to NoSide or None).

To support this a new Toplevel::inputGeometry() -> QRect method is
added which exposes the geometry adjusted by the margins provided by
the decoration. This is checked in InputRedirection when finding a
Toplevel at a given position. The logic for figuring out whether the
event should go to the decoration or the window already handled the
situation correctly, so no further changes are needed.

BUG: 364607
FIXED-IN: 5.8.1

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2787
2016-10-05 07:49:23 +02:00
Martin Gräßlin 7dfe408506 Pass Qt::Key to GlobalShortcutsManager::processKey
So far this method translated the keysym to Qt::Key. This is no longer
needed as the only method which invokes processKey has access to the
translated key. Thus saving one translation for every key press.

Reviewed-By: bshah
2016-09-15 09:02:38 +02:00
Martin Gräßlin 8fdcc24b05 Better handling for forwarding key events to Wayland Server
A new protected method is added to InputEventFilter to forward a
QKeyEvent to the Wayland server. Several input filters need to forward
the event to have a proper state of the events. E.g. the TabBox filter,
but also the internal window filter and effects filter. It's important
to update all events even if the events are not forwarded to a surface.

This new method takes care of the general handling like ignoring key
repeats, etc.

Reviewed-By: bshah
2016-09-15 08:47:01 +02:00
Martin Gräßlin c70df62ce5 Pass all key events during Alt+Tab to the Wayland Seat
When Alt+(Shift)+Tab is grabbed we have the modifier press key being
passed to the Wayland server as key events are not yet grabbed. As KWin
grabbed the release event the Wayland server considered the key still as
pressed when going into the next application.

This change ensures that all events are also passed to the wayland
server. As no surface has focus we can be sure that it won't be passed
to the application, but it ensures that the events are processed
correctly.

Reviewed-By: bshah
2016-09-15 08:31:05 +02:00
Martin Gräßlin c71b002b24 [wayland] Fix release of TabBox on Wayland
Summary:
The interaction is changed to trigger the check for release from the
TabBoxInputFilter instead of reacting on modifier changes. That way
it's possible to check for the relevant modifiers getting released
instead of getting all modifiers in. Also this means that the checks
are only performed when relevant.

BUG: 368590

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2773
2016-09-14 13:26:58 +02:00
Martin Gräßlin 4235871667 Remove not-wanted modifiers prior to evaluating global shortcuts
Summary:
When triggering global shortcuts we are more interested in the hold
keys than the currently active modifiers. E.g. capslock should not
be seen as "shift is hold". Similar we need to remove consumed
modifiers. Shift+5 is % and not Shift+% - the shift modifier is
consumed and needs to be removed from shortcut evaluation.

To support this we need to have the actual state directly from
xkbcommon. Thus a new method is added which exposes the modifiers
relevant for global shortcut matching. In addition on every key press
all consumed modifiers are calculated and kept so that they can be
used for shortcut matching.

In addition a workaround is added for Backtab. Similar workaround
exists in kglobalaccel for X11. The problem is that our shortcuts are
stored incorrectly: Shift+Tab instead of Backtab. Thus a mapping back
is required. To make everything worse KWin registers the wrong key
sequence "Alt+Shift+Backtab" which doesn't make any sense and is
broken on X11 at least.

The workaround supports both special cases. The one for Backtab should
be turned into Shift+Tab and also KWin's special case of adding shift
to backtab.

CCBUG: 368581

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2768
2016-09-14 10:25:13 +02:00
Martin Gräßlin 3a3d1b6b0d DebugConsole window does not take keyboard input
Summary:
In order to add more tabs which can further help monitoring how KWin
handles some aspects the DebugConsole is changed to not take keyboard
input. This means it can only be navigated using pointer device or touch
screen.

This is needed for adding a new tab to monitor clipboard changes. On
Wayland sometimes windows don't get the clipboard, so it would be
helpful to have a debug monitor to see when the clipboard changes. But
for that debug console window may not take keyboard events.

To support this DebugConsole sets the WA_ShowWithoutActivating attribute
which gets honored by the InternalWindowEventFilter and does not forward
key events to such windows.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2620
2016-09-12 13:24:33 +02:00
Martin Gräßlin 6af0cc6ebe Add support for touch events in the Effect system
Summary:
The Effect class is extended by three new virtual methods:
* touchDown
* touchMotion
* touchUp

The methods return a boolean value so that the events can be filtered
out. E.g. an effect which has also a mouse grab installed wants to
filter out all events, other effects don't need the events exclusively.

This is a difference to how e.g. keyboard and pointer events are handled.
But is more close to how KWin's internal input event passing works and
makes it easier to get touch event: one does not explicitly has to grab
the events. It's also closer to Wayland where all input events are
available.

As a first example the Present Windows effect is adjusted and allows to
activate windows through the touch screen. As much code as possible is
shared with pointer input.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2450
2016-08-16 14:18:40 +02:00
Martin Gräßlin 4651aa1d79 [wayland] Unset focused keyboard surface when handling key event internally
Summary:
So far when KWin intercepted a key event a leave was not sent to the
Wayland surface currently having keyboard focus. This could result in
the Wayland application to start repeating keys. E.g.

1. application gets key press event
2. This triggers an internal window to show
3. key release goes to KWin internal window
4. application starts to repeat key as there is no release

With this change whenever KWin intercepts the key event e.g. due to
 * internal window
 * Effects grabbing key event
 * Tabbox

the focused keyboard surface is set to null, thus triggering a leave
event and the client not starting to repeat the event.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2402
2016-08-16 07:40:59 +02:00
Martin Gräßlin 1111b9c98b Trigger global shortcuts also on key-repeat
Summary:
Restores feature parity with X11. Global shortcuts need to trigger
also for repeat events. An example is the volume key or screen
brightness.

For other shortcuts like showing yakuake it does not make sense to
trigger on repeat. Thus a long term solution is to add a flag to
global shortcuts whether the key should trigger on repeat.

BUG: 366608

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2413
2016-08-15 17:39:01 +02:00
Martin Gräßlin 981b312323 [Wayland] Make it possible to have internal windows decorated
Summary:
With this change KWin can create window decorations for internal windows.
Thus it's also possible to move internal windows and resize them which is
especially important for the debug console.

Reviewers: #kwin, #plasma_on_wayland, sebas

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2371
2016-08-08 14:00:32 +02:00
Martin Gräßlin 8a83a6fef5 [libinput] Add support for gesture events
Summary:
Gesture events are swipe or pinch events on a touch pad.

This change implements basic support by:
 * wrapping them in LibInput::Event
 * processing them in LibInput::Connection and emitting
   dedicated signals
 * Forwarding them in InputRedirection to PointerInputRedirection
 * Support them in the internal input event filter
 * Printing debug information in DebugConsole

Further handling is not yet done. In future the following should be
implemented:
 * activating e.g. zoom and present windows on pinch/swipe gesture
 * forwarding non global gestures to KWayland

Note that forwarding to KWayland is not yet useful as QtWayland does
not yet have support for the unstable protocol. No Qt application could
make use of it yet. So for the moment just global gestures is the best
we can get.

Test Plan: Looked at output of DebugConsole when triggering gestures

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2359
2016-08-08 09:15:06 +02:00
Martin Gräßlin 4c6c4e6717 [wayland] Always have a keyboard on the Seat
Summary:
This is a workaround for QTBUG-54371 resulting in QtWayland never
requesting the input methods panel without having keyboard focus.
Thus also the virtual keyboard is not working.

With this change we go back to always announcing a keyboard and
binding the virtual keyboard to whether we don't have an alpha-numeric
keyboard instead of whether there is a keyboard on the seat.

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2343
2016-08-03 11:27:00 +02:00
Martin Gräßlin a35ffa93d7 Use hiddenInternal() for a ShellClient which got unmapped
Summary:
So far when a ShellClient got unmapped ready_for_painting was set to
false. That is the ShellClient was treated in the same way as a not
yet shown window. It was completely excluded from painting, a close
animation impossible.

This change makes use of the functionality available in
Client::hiddenInternal(). The window is considered as hidden, thus
still excluded from e.g. getting input events, but could be rendered
any time as we still have a previous window pixmap (if referenced).
This allows to have it considered in the rendering pass, but effects
still cannot make use of it as that state is not yet exposed to the
effects.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2083
2016-07-13 10:45:10 +02:00
Martin Gräßlin f9baa22f0d Fix unsigned-signed comparison with touch id in input.cpp
The id we internally have is a signed int and might be negative, but
the touch id we get is unsigned. We can savely cast the unsigned to
signed as touch ids are recycled and more than 10 touch points is
unlikely to be useful.
2016-06-29 11:03:43 +02:00
Martin Gräßlin 95449e0843 Fix unused parameter warnings 2016-06-29 10:50:51 +02:00
Bhavisha Dhruve 6cae5f7ab9 Integrated FakeInput touch events into InputRedirection.
Summary: KWin counterpart for touch event support in Fakeinput interface.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1758
2016-06-03 19:52:22 +05:30
Martin Gräßlin 69cbb40903 Pass LibInput::Device* through the event handlers
Summary:
The signals emitted by LibInput::Connection carry the Device for which
the input event was received. This Device is passed to the input handlers.

Custom event classes are added which extend QMouseEvent, QKeyEvent and
QWheelEvent respectively and expose the Device. The Device is only passed
around as a forward declared pointer, so even if compiled without libinput
support, it should still compile.

Event handlers which need to get access to the Device can now just cast
the event pointer to the custom class and access it. This can be used in
future to handle device specific key codes, etc.

As we don't have a proper event classes for touch events the event
handlers do not yet have access to the Device. Here the internal API
needs to be adjusted in future.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1667
2016-05-30 15:26:37 +02:00
Martin Gräßlin 6f733c3bd0 Bind seat hasKeyboard capability to alphanumeric keyboard availability
Summary:
Just because we have a power button, doesn't mean we have a keyboard.
So let's bind the seat keyboard to whether we have a proper keyboard.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1681
2016-05-25 12:13:33 +02:00
Martin Gräßlin ff88f93852 Support touch events on KWin internal windows
Summary:
Qt's touch event API is rather difficult and complex to implement.
As none of KWin's internal windows supports multi-touch gestures yet,
this is going the easy route and just simulates a left mouse button
press. If in future need arises for touch gesture support on KWin's
internal windows, this can be added.

Test Plan: Tested on exopc with DebugConsole and auto test

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1661
2016-05-23 18:40:06 +02:00
Martin Gräßlin 73fae5e63d Support touch events in DecorationEventFilter
Summary:
Touch events are emulating mouse events, in particular left mouse
button.

With this change one can move windows through the decoration, use
the decoration buttons and also support the double click action.

As finding the decoration is pretty much exactly the same as for
pointer events, a new base class is introduces which provides the
functionality of updating the decoration and the shared common
variables.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1604
2016-05-17 07:33:02 +02:00
Martin Gräßlin 14d12c0585 Do not limit mouse actions to titleBarArea but allow on complete titleBarPosition
Summary:
Mouse actions like wheel and double click were restricted to the titleBar
area. This made the top most pixel non-interactive as it's not part of the
titleBarArea.

This change makes the complete titlebarPosition interactive. That is it
includes for a "normal" (top) setup also the TopLeft/Top/Right section.
Thus the top most pixel can be double clicked, mouse wheeled, etc.

For the Wayland case the test case is adjusted.

BUG: 362860
FIXED-IN: 5.7.0

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1596
2016-05-12 16:58:15 +02:00
Martin Gräßlin 254573bee1 [libinput] Support for left-handed pointer
Summary:
The configuration file kcminput, group Mouse is parsed to decide whether
pointer devices should be in left handed mode. The config is applied
whenever a new device is added.

In addition the Connection listens to KGlobalSettings for a mouse
settings changed signal which might be emitted by the mouse KCM.

When such a signal is emitted, all pointer devices are reconfigured.

This allows to change the mouse handed settings on Wayland.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1543
2016-05-11 14:12:25 +02:00
Martin Gräßlin a25bf237e0 Integrate libinput only through Logind instead of relying on VirtualTerminal
All the important information like whether we are on the active vt are
also provided by Logind. So instead of integrating with VirtualTerminal,
which integrates with Logind, we can just integrate with Logind directly.
2016-04-22 14:18:56 +02:00
Martin Gräßlin a21ad8d4fa Switch virtual teminal through logind seat
When we get the key code for virtual terminal switching we pass it
to Logind instead of going through the "legacy" ioctl interface.
2016-04-22 14:18:56 +02:00
Martin Gräßlin d31e9e88b4 Rename abstract_backend.(h|cpp) to platform.(h|cpp)
Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1340
2016-04-07 16:18:12 +02:00
Martin Gräßlin 5dc6da0bbe Merge branch 'Plasma/5.6' 2016-03-14 10:25:51 +01:00
Martin Gräßlin 0b9e6a4aa2 Fix start move through drag distance on window decoration
We need to call handleMoveResize on the mouse move with button down.

Auto tests adjusted to include all possible directions.
2016-03-11 12:48:01 +01:00
Martin Gräßlin 16301aa4cf Implement a TerminateServerFilter to handle XKB_KEY_Terminate_Server
On special request by sebas. It's not really dangerous as by default
the xkb layout doesn't have it enabled. So if a user actually enables
it, we can also support it.

And now I'm going to reconfigure my layout again to not hit it by chance.

Reviewed-By: sebas
2016-03-10 20:30:49 +01:00
Martin Gräßlin abca474d44 Don't pass keyboard events to internal windows outside the screen geometry
PresentWindows moves the close button outside the visible area. We
don't want that one to take all key events.
2016-03-09 22:21:10 +01:00
Martin Gräßlin 2c0df531b7 Only pass key press events to TabBox
We want TabBox to operate on key press, not on key release. So far
it only operated on release as the press was filtered out by the
global shortcuts filter. To prevent that the tab box filter is moved
before the global shortcuts filter.

Note: first usage of TabBox has current window selected instead of
next. This problem is also visible on X11.
2016-03-04 15:40:20 +01:00
Martin Gräßlin d2716c834b Pass pointer and wheel events to TabBox from special event filter
The TabBox implements methods for those events and performs same
logic as on X11. Click outside of TabBox closes. If the event is on
the TabBox we don't filter the event out and let the internal filter
forward the event.
2016-03-04 14:18:32 +01:00
Martin Gräßlin 8a1f19b145 Add support for Drag'n'Drop on Wayland
Drag'n'Drop on Wayland allows us to improve the drag'n'drop experience.
When entering a window during the drag'n'drop operation, KWin raises it.

BUG: 36065
FIXED-IN: 5.6.0 (Wayland only)
2016-03-02 08:34:41 +01:00
Martin Gräßlin ed7bf6e091 Send leave/enter pointer event when starting/stoping effect mouse interception
When starting effect mouse interception the current focused window
and or decoration should get a leave event. Similar when the effect mouse
interception ends the current pointer position needs to be evaluated and
a pointer enter be sent if needed.
2016-02-25 09:15:41 +01:00
Martin Gräßlin a029300ce5 Rework cursor image handling for Wayland
So far updating the cursor image was not really defined. It was possible
to use the cursor image from the wayland seat or have a custom set cursor
image. But there are no rules in place to decide which one to use when.

With this change a dedicated CursorImage class is introduced which tracks
the cursor image changes on the seat, on the decoration, in the effects
and so on. In addition it tracks which is the current source for the
image, that is whether e.g. the cursor from the seat or from effects
override should be used. Whenever the cursor image changes a signal is
emitted, which is connected to the signal in AbstractBackend.

Based on that the backends can directly show the image. The existing
code in the backends to install a cursor shape or to install the cursor
from the server is completely dropped. For the backend it's irrelevant
from where the image comes from.

A new feature added is that the cursor image is marked as rendered. This
is then passed on to the frame rendered in the Surface and thus animated
cursors are finally working. Unfortunately animated cursors are broken in
Qt (see https://bugreports.qt.io/browse/QTBUG-48181 ).
2016-02-25 08:14:48 +01:00
Martin Gräßlin 9eeef2d9ca Fix mouse action on (in)active window
Small regression: the command didn't get updated at all, so it was always
MouseNothing.

To prevent such a regression to sneak in again the change comes with
autotest for the action on inactive and active window.
2016-02-22 10:07:02 +01:00
Martin Gräßlin 83a4fe5408 Update keyboard modifier state on seat after each key event
The layout might have changed, thus we should notify the client about
it. The server ensures that on no state change it's not sent to the
client.
2016-02-19 13:59:02 +01:00
Martin Gräßlin cb3c6a4780 Implement internal keyboard repeat
As a Wayland server KWin does not have to emit additional key repeat
events (unlike X11). The clients are responsible for handling this based
on the provided key repeat information.

Internally KWin needs key repeat, though. E.g. the effects need key
repeat (filtering in Present Windows), window moving by keyboard needs
repeat, etc. etc.

This change introduces the internal key repeat. For each key press a
QTimer is started which gets canceled again on the key release. If the
timer fires it invoked processKey with a new KeyboardKeyAutoRepeat state.
This is handled just like a KeyPress, but states are not updated and
the QKeyEvent has autorepeat set to true.

The event filters check for the autorepeat state and filter the event
out if they are not interested in it. E.g. the filters passing the event
to the Wayland client need to filter it out.

Currently auto-repeat is bound to using libinput. This needs to be
modified. The only backend sending repeated events is X11, thus for
other backends it should be enabled.

Whether creating a timer on each key event is a good idea is something to
evaluate in future.

Reviewed-By: Bhushan Shah
2016-02-19 08:22:53 +01:00
Martin Gräßlin 6d47839e95 Fix scroll direction on window wheel command
Experimental testing in real world showed it's just a signing issue
in this specific case. The events passed to wayland clients scroll
in correct direction.
2016-02-18 10:11:20 +01:00
Martin Gräßlin e6e11f7853 Move window action handling logic into a dedicated InputEventFilter
The logic so far was in the end to decide whether the event should
be further processed or not. This can be better done by a dedicated
event filter.
2016-02-18 09:57:47 +01:00
Martin Gräßlin 2a98c681d0 Implement whell command in input handling
With that all the actions are implemented just like on X11.

There are two not yet implemented differences:
* hide splash window when clicking it
* replay event on special window
2016-02-18 09:18:39 +01:00