[Differential] [Request, 36 lines] D2953: [tabbox] Intercept QWheelEvents on QQuickWindow for scrolling

graesslin (Martin Gräßlin) noreply at phabricator.kde.org
Thu Oct 6 06:18:31 UTC 2016


graesslin created this revision.
graesslin added reviewers: KWin, Plasma, broulik.
Restricted Application added a project: KWin.
Restricted Application added subscribers: kwin, plasma-devel.

REVISION 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.1

TEST PLAN
  Scrolled with touchpad and mouse wheel.

REPOSITORY
  rKWIN KWin

BRANCH
  tabbox-wheelevent-5.8

REVISION DETAIL
  https://phabricator.kde.org/D2953

AFFECTED FILES
  tabbox/tabboxhandler.cpp
  tabbox/tabboxhandler.h

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: graesslin, #kwin, #plasma, broulik
Cc: plasma-devel, kwin, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161006/d28b6bf7/attachment.html>


More information about the Plasma-devel mailing list