kwin/tabbox
Martin Gräßlin e9d20b80e9 [tabbox] Intercept QWheelEvents on QQuickWindow for scrolling
Summary:
The TabBox performs the scrolling of the items by itself in order to
support wheel events even if the mouse is not on the TabBox. For that
KWin grabs pointer events on X11 (on Wayland an input filter is used)
and forwards them to the TabBox.

Qt uses Xinput2 for scrolling on the QQuickWindow. Due to that KWin
does not get any xcb core button press/release events when scrolling
inside the QQuickWindow and thus scrolling doesn't work.

There are three possible approaches to fix this:
1. Implement scrolling support in each of the QML switchers
2. Add an xinput2 filter to TabBox
3. Intercept the QWheelEvents on the QQuickWindow

The first approach has the disadvantage that all themes need
adjustment and that there might be behaviorial difference whether one
scrolls on the TabBox window or outside the window.

The second approach would be most in line with the other filters, but
is difficult due to the nature of xinput2 (no xcb bindings, etc).

Thus the third approach might be the best solution. Wheel events are
only delivered to the QQuickWindow if the native events were not already
intercepted, thus we know it won't have side effects for the case that
Wayland is used or xinput2 is not supported.

The implementation installs an event filter on the QQuickWindow which
gets created when showing the TabBox and inside the filter waits till
there is an angleDelta of +/-120 and scrolls by one per every 120 angle
delta as described in the QWheelEvent documentation.

BUG: 369661
FIXED-IN: 5.8.2

Test Plan: Scrolled with touchpad and mouse wheel.

Reviewers: #kwin, #plasma, broulik

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2953
2016-10-17 08:23:39 +02:00
..
CMakeLists.txt Move tabbox/autotests to autotests/tabbox 2016-06-29 10:38:17 +02:00
clientmodel.cpp Replace NULL with nullptr in tabbox folder 2014-02-24 16:42:43 +01:00
clientmodel.h Replace NULL with nullptr in tabbox folder 2014-02-24 16:42:43 +01:00
desktopchain.cpp Fix comparison between signed and unsigned integer expressions warning 2014-04-28 17:29:06 +02:00
desktopchain.h Replace NULL with nullptr in tabbox folder 2014-02-24 16:42:43 +01:00
desktopmodel.cpp [kwin] Add a method longestCaption() in TabBox::DesktopModel. 2013-12-22 10:40:28 +01:00
desktopmodel.h Replace NULL with nullptr in tabbox folder 2014-02-24 16:42:43 +01:00
kwindesktopswitcher.desktop SVN_SILENT made messages (.desktop file) - always resolve ours 2016-08-29 09:19:15 +00:00
kwinwindowswitcher.desktop SVN_SILENT made messages (.desktop file) - always resolve ours 2016-08-29 09:19:15 +00:00
switcheritem.cpp update SwitcherItem::screenGeometry when showing 2015-08-19 12:31:31 +02:00
switcheritem.h [kwin/tabbox] Use a QmlComponent instead of a QQuickView for TabBox 2013-12-12 09:37:29 +01:00
tabbox.cpp [wayland] Fix release of TabBox on Wayland 2016-09-14 13:26:58 +02:00
tabbox.h [wayland] Fix release of TabBox on Wayland 2016-09-14 13:26:58 +02:00
tabbox_logging.cpp pedantic fixes 2016-07-16 13:14:44 -04:00
tabbox_logging.h [tabbox] Add dedicated logging category for TabBox 2015-07-31 13:13:41 +02:00
tabboxconfig.cpp Remove show outline from TabBox 2013-04-24 10:02:57 +02:00
tabboxconfig.h [tabbox] Try locating the WindowSwitcher QML through configured lnf package 2014-10-28 16:53:23 +01:00
tabboxhandler.cpp [tabbox] Intercept QWheelEvents on QQuickWindow for scrolling 2016-10-17 08:23:39 +02:00
tabboxhandler.h [tabbox] Intercept QWheelEvents on QQuickWindow for scrolling 2016-10-17 08:23:39 +02:00