<table><tr><td style="">graesslin created this revision.<br />graesslin added reviewers: KWin, Plasma, broulik.<br />Restricted Application added a project: KWin.<br />Restricted Application added subscribers: kwin, plasma-devel.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D2953" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The TabBox performs the scrolling of the items by itself in order to<br />
support wheel events even if the mouse is not on the TabBox. For that<br />
KWin grabs pointer events on X11 (on Wayland an input filter is used)<br />
and forwards them to the TabBox.</p>
<p>Qt uses Xinput2 for scrolling on the QQuickWindow. Due to that KWin<br />
does not get any xcb core button press/release events when scrolling<br />
inside the QQuickWindow and thus scrolling doesn't work.</p>
<p>There are three possible approaches to fix this:</p>
<ol class="remarkup-list">
<li class="remarkup-list-item">Implement scrolling support in each of the QML switchers</li>
<li class="remarkup-list-item">Add an xinput2 filter to TabBox</li>
<li class="remarkup-list-item">Intercept the QWheelEvents on the QQuickWindow</li>
</ol>
<p>The first approach has the disadvantage that all themes need<br />
adjustment and that there might be behaviorial difference whether one<br />
scrolls on the TabBox window or outside the window.</p>
<p>The second approach would be most in line with the other filters, but<br />
is difficult due to the nature of xinput2 (no xcb bindings, etc).</p>
<p>Thus the third approach might be the best solution. Wheel events are<br />
only delivered to the QQuickWindow if the native events were not already<br />
intercepted, thus we know it won't have side effects for the case that<br />
Wayland is used or xinput2 is not supported.</p>
<p>The implementation installs an event filter on the QQuickWindow which<br />
gets created when showing the TabBox and inside the filter waits till<br />
there is an angleDelta of +/-120 and scrolls by one per every 120 angle<br />
delta as described in the QWheelEvent documentation.</p>
<p>BUG: 369661<br />
FIXED-IN: 5.8.1</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Scrolled with touchpad and mouse wheel.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>rKWIN KWin</div></div></div><br /><div><strong>BRANCH</strong><div><div>tabbox-wheelevent-5.8</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D2953" rel="noreferrer">https://phabricator.kde.org/D2953</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>tabbox/tabboxhandler.cpp<br />
tabbox/tabboxhandler.h</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>graesslin, KWin, Plasma, broulik<br /><strong>Cc: </strong>plasma-devel, kwin, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas<br /></div>