https://bugs.kde.org/show_bug.cgi?id=369661

Martin Gräßlin <mgraess...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|                            |http://commits.kde.org/kwin
                   |                            |/e9d20b80e9a79f514a219357d9
                   |                            |91092d83665350
   Version Fixed In|                            |5.8.2
         Resolution|---                         |FIXED
             Status|CONFIRMED                   |RESOLVED

--- Comment #6 from Martin Gräßlin <mgraess...@kde.org> ---
Git commit e9d20b80e9a79f514a219357d991092d83665350 by Martin Gräßlin.
Committed on 17/10/2016 at 06:23.
Pushed by graesslin into branch 'Plasma/5.8'.

[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.
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

M  +32   -0    tabbox/tabboxhandler.cpp
M  +2    -0    tabbox/tabboxhandler.h

http://commits.kde.org/kwin/e9d20b80e9a79f514a219357d991092d83665350

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to