diff -Nru qtbase-opensource-src-5.5.1+dfsg/debian/changelog qtbase-opensource-src-5.5.1+dfsg/debian/changelog --- qtbase-opensource-src-5.5.1+dfsg/debian/changelog 2016-09-12 05:49:32.000000000 +0000 +++ qtbase-opensource-src-5.5.1+dfsg/debian/changelog 2017-05-03 19:22:47.000000000 +0000 @@ -1,3 +1,25 @@ +qtbase-opensource-src (5.5.1+dfsg-16ubuntu7.5) xenial; urgency=medium + + * Backport upstream change to fix behavior of QMenuBar::isNativeMenuBar() + method (fix_isNativeMenuBar.diff). This should finally fix LP: #1380702. + + -- Dmitry Shachnev Wed, 03 May 2017 22:22:47 +0300 + +qtbase-opensource-src (5.5.1+dfsg-16ubuntu7.4) xenial; urgency=medium + + [ Elvis Stansvik ] + * debian/patches/xcb-compress-mouse-motion-and-touch-update-events.patch: + - Backport event compression fix from Qt 5.6 branch (LP: #1598173) + + -- Dmitry Shachnev Thu, 23 Mar 2017 23:17:09 +0300 + +qtbase-opensource-src (5.5.1+dfsg-16ubuntu7.3) xenial; urgency=medium + + * Backport upstream change to make shortcuts working with global menu + on Unity (global_menu_shortcuts.diff, LP: #1380702). + + -- Dmitry Shachnev Mon, 13 Mar 2017 18:40:39 +0300 + qtbase-opensource-src (5.5.1+dfsg-16ubuntu7.2) xenial; urgency=medium * debian/patches/Fix-parsing-of-tzfile-5-POSIX-rule-zone-names-with-b.patch: diff -Nru qtbase-opensource-src-5.5.1+dfsg/debian/patches/fix_isNativeMenuBar.diff qtbase-opensource-src-5.5.1+dfsg/debian/patches/fix_isNativeMenuBar.diff --- qtbase-opensource-src-5.5.1+dfsg/debian/patches/fix_isNativeMenuBar.diff 1970-01-01 00:00:00.000000000 +0000 +++ qtbase-opensource-src-5.5.1+dfsg/debian/patches/fix_isNativeMenuBar.diff 2017-05-03 19:22:36.000000000 +0000 @@ -0,0 +1,65 @@ +Description: make QMenuBar::isNativeMenuBar() more reliable + Now it will not return true if the QPA plugin provides no platform menu bar, + and will not return false when Ubuntu global menu is in use. + . + Instead of trying to keep that variable in sync with platformMenuBar + state, just check whether platformMenuBar exists instead. +Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=835d7cf54328bdd9 +Last-Update: 2017-05-03 + +--- a/src/widgets/widgets/qmenubar.cpp ++++ b/src/widgets/widgets/qmenubar.cpp +@@ -1810,10 +1810,8 @@ + void QMenuBar::setNativeMenuBar(bool nativeMenuBar) + { + Q_D(QMenuBar); +- if (d->nativeMenuBar == -1 || (nativeMenuBar != bool(d->nativeMenuBar))) { +- d->nativeMenuBar = nativeMenuBar; +- +- if (!d->nativeMenuBar) { ++ if (nativeMenuBar != bool(d->platformMenuBar)) { ++ if (!nativeMenuBar) { + delete d->platformMenuBar; + d->platformMenuBar = 0; + } else { +@@ -1822,7 +1820,7 @@ + } + + updateGeometry(); +- if (!d->nativeMenuBar && parentWidget()) ++ if (!nativeMenuBar && parentWidget()) + setVisible(true); + } + } +@@ -1830,10 +1828,7 @@ + bool QMenuBar::isNativeMenuBar() const + { + Q_D(const QMenuBar); +- if (d->nativeMenuBar == -1) { +- return !QApplication::instance()->testAttribute(Qt::AA_DontUseNativeMenuBar); +- } +- return d->nativeMenuBar; ++ return bool(d->platformMenuBar); + } + + /*! +--- a/src/widgets/widgets/qmenubar_p.h ++++ b/src/widgets/widgets/qmenubar_p.h +@@ -59,7 +59,7 @@ + public: + QMenuBarPrivate() : itemsDirty(0), currentAction(0), mouseDown(0), + closePopupMode(0), defaultPopDown(1), popupState(0), keyboardState(0), altPressed(0), +- nativeMenuBar(-1), doChildEffects(false), platformMenuBar(0) ++ doChildEffects(false), platformMenuBar(0) + + #ifdef Q_OS_WINCE + , wce_menubar(0), wceClassicMenu(false) +@@ -102,8 +102,6 @@ + uint keyboardState : 1, altPressed : 1; + QPointer keyboardFocusWidget; + +- +- int nativeMenuBar : 3; // Only has values -1, 0, and 1 + //firing of events + void activateAction(QAction *, QAction::ActionEvent); + diff -Nru qtbase-opensource-src-5.5.1+dfsg/debian/patches/global_menu_shortcuts.diff qtbase-opensource-src-5.5.1+dfsg/debian/patches/global_menu_shortcuts.diff --- qtbase-opensource-src-5.5.1+dfsg/debian/patches/global_menu_shortcuts.diff 1970-01-01 00:00:00.000000000 +0000 +++ qtbase-opensource-src-5.5.1+dfsg/debian/patches/global_menu_shortcuts.diff 2017-03-13 15:39:23.000000000 +0000 @@ -0,0 +1,55 @@ +Description: make shortcuts work for platform menu bars + When a platform menu bar is used, the QMenuBar is hidden, so shortcuts + for QActions attached only to it do not work. +Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=287f548d4c7cc594 +Bug: https://bugs.launchpad.net/bugs/1380702 +Last-Update: 2017-02-13 + +--- a/src/widgets/kernel/qshortcut.cpp ++++ b/src/widgets/kernel/qshortcut.cpp +@@ -135,9 +135,11 @@ + static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidget *active_window) + { + bool visible = w->isVisible(); +-#ifdef Q_OS_MAC +- if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast(w)) +- visible = true; ++#ifndef QT_NO_MENUBAR ++ if (QMenuBar *menuBar = qobject_cast(w)) { ++ if (menuBar->isNativeMenuBar()) ++ visible = true; ++ } + #endif + + if (!visible || !w->isEnabled()) +--- a/src/widgets/widgets/qmenubar.cpp ++++ b/src/widgets/widgets/qmenubar.cpp +@@ -1281,10 +1281,12 @@ + } else if(e->type() == QEvent::ActionRemoved) { + e->action()->disconnect(this); + } +- if (isVisible()) { ++ // updateGeometries() is also needed for native menu bars because ++ // it updates shortcutIndexMap ++ if (isVisible() || isNativeMenuBar()) + d->updateGeometries(); ++ if (isVisible()) + update(); +- } + } + + /*! +@@ -1704,6 +1706,13 @@ + { + Q_Q(QMenuBar); + QAction *act = actions.at(id); ++ if (act && act->menu()) { ++ if (QPlatformMenu *platformMenu = act->menu()->platformMenu()) { ++ platformMenu->showPopup(q->windowHandle(), actionRects.at(id), Q_NULLPTR); ++ return; ++ } ++ } ++ + setCurrentAction(act, true, true); + if (act && !act->menu()) { + activateAction(act, QAction::Trigger); diff -Nru qtbase-opensource-src-5.5.1+dfsg/debian/patches/series qtbase-opensource-src-5.5.1+dfsg/debian/patches/series --- qtbase-opensource-src-5.5.1+dfsg/debian/patches/series 2016-09-12 05:49:13.000000000 +0000 +++ qtbase-opensource-src-5.5.1+dfsg/debian/patches/series 2017-05-03 19:18:27.000000000 +0000 @@ -37,6 +37,9 @@ xcb-Fix-drag-and-drop-to-applications-like-Emacs-and.patch xcb-Fix-drag-and-drop-to-Emacs.patch Fix-parsing-of-tzfile-5-POSIX-rule-zone-names-with-b.patch +fix_isNativeMenuBar.diff +global_menu_shortcuts.diff +xcb-compress-mouse-motion-and-touch-update-events.patch # Debian specific. gnukfreebsd.diff diff -Nru qtbase-opensource-src-5.5.1+dfsg/debian/patches/xcb-compress-mouse-motion-and-touch-update-events.patch qtbase-opensource-src-5.5.1+dfsg/debian/patches/xcb-compress-mouse-motion-and-touch-update-events.patch --- qtbase-opensource-src-5.5.1+dfsg/debian/patches/xcb-compress-mouse-motion-and-touch-update-events.patch 1970-01-01 00:00:00.000000000 +0000 +++ qtbase-opensource-src-5.5.1+dfsg/debian/patches/xcb-compress-mouse-motion-and-touch-update-events.patch 2017-03-23 20:16:50.000000000 +0000 @@ -0,0 +1,449 @@ +Description: xcb: Compress mouse motion and touch update events + The current version of the mouse motion event compression algorithm + does not work with certain configurations — situations where we get + one XCB_GE_GENERIC event between every XCB_MOTION_NOTIFY event. + . + The new implementation tries to be less fragile. The previous approach + checked “is *the next* event the same type as the current event”, the + new check asks “have we buffered more events of the same type as the + current event”. We buffer events of the same type only when the main + thread is unresponsive. + . + This patch adds event compression for XI_TouchUpdate in addition to + the fix for motion even compression. +Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=7edd10e6cc215c41 +Bug: https://bugs.launchpad.net/bugs/1598173 +Last-Update: 2017-03-23 + +--- a/src/plugins/platforms/xcb/qxcbconnection.cpp ++++ b/src/plugins/platforms/xcb/qxcbconnection.cpp +@@ -107,6 +107,24 @@ + #define XCB_GE_GENERIC 35 + #endif + ++// Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed: ++// - "pad0" became "extension" ++// - "pad1" and "pad" became "pad0" ++// New and old version of this struct share the following fields: ++typedef struct qt_xcb_ge_event_t { ++ uint8_t response_type; ++ uint8_t extension; ++ uint16_t sequence; ++ uint32_t length; ++ uint16_t event_type; ++} qt_xcb_ge_event_t; ++ ++static inline bool isXIEvent(xcb_generic_event_t *event, int opCode) ++{ ++ qt_xcb_ge_event_t *e = (qt_xcb_ge_event_t *)event; ++ return e->extension == opCode; ++} ++ + #ifdef XCB_USE_XLIB + static const char * const xcbConnectionErrors[] = { + "No error", /* Error 0 */ +@@ -1139,7 +1157,7 @@ + #if defined(XCB_USE_XINPUT2) + case XCB_GE_GENERIC: + // Here the windowEventListener is invoked from xi2HandleEvent() +- if (m_xi2Enabled) ++ if (m_xi2Enabled && isXIEvent(event, m_xiOpCode)) + xi2HandleEvent(reinterpret_cast(event)); + break; + #endif +@@ -1467,6 +1485,105 @@ + + #endif + ++#if defined(XCB_USE_XINPUT2) ++// it is safe to cast XI_* events here as long as we are only touching the first 32 bytes, ++// after that position event needs memmove, see xi2PrepareXIGenericDeviceEvent ++static inline bool isXIType(xcb_generic_event_t *event, int opCode, uint16_t type) ++{ ++ if (!isXIEvent(event, opCode)) ++ return false; ++ ++ xXIGenericDeviceEvent *xiEvent = reinterpret_cast(event); ++ return xiEvent->evtype == type; ++} ++#endif ++static inline bool isValid(xcb_generic_event_t *event) ++{ ++ return event && (event->response_type & ~0x80); ++} ++ ++/*! \internal ++ ++ Compresses events of the same type to avoid swamping the event queue. ++ If event compression is not desired there are several options what developers can do: ++ ++ 1) Write responsive applications. We drop events that have been buffered in the event ++ queue while waiting on unresponsive GUI thread. ++ 2) Use QAbstractNativeEventFilter to get all events from X connection. This is not optimal ++ because it requires working with native event types. ++ 3) Or add public API to Qt for disabling event compression QTBUG-44964 ++ ++*/ ++bool QXcbConnection::compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const ++{ ++ uint responseType = event->response_type & ~0x80; ++ int nextIndex = currentIndex + 1; ++ ++ if (responseType == XCB_MOTION_NOTIFY) { ++ // compress XCB_MOTION_NOTIFY notify events ++ for (int j = nextIndex; j < eventqueue->size(); ++j) { ++ xcb_generic_event_t *next = eventqueue->at(j); ++ if (!isValid(next)) ++ continue; ++ if (next->response_type == XCB_MOTION_NOTIFY) ++ return true; ++ } ++ return false; ++ } ++#if defined(XCB_USE_XINPUT2) ++ // compress XI_* events ++ if (responseType == XCB_GE_GENERIC) { ++ if (!m_xi2Enabled) ++ return false; ++ ++ // compress XI_Motion ++ if (isXIType(event, m_xiOpCode, XI_Motion)) { ++ for (int j = nextIndex; j < eventqueue->size(); ++j) { ++ xcb_generic_event_t *next = eventqueue->at(j); ++ if (!isValid(next)) ++ continue; ++ if (isXIType(next, m_xiOpCode, XI_Motion)) ++ return true; ++ } ++ return false; ++ } ++#ifdef XCB_USE_XINPUT22 ++ // compress XI_TouchUpdate for the same touch point id ++ if (isXIType(event, m_xiOpCode, XI_TouchUpdate)) { ++ xXIDeviceEvent *xiDeviceEvent = reinterpret_cast(event); ++ uint32_t id = xiDeviceEvent->detail % INT_MAX; ++ for (int j = nextIndex; j < eventqueue->size(); ++j) { ++ xcb_generic_event_t *next = eventqueue->at(j); ++ if (!isValid(next)) ++ continue; ++ if (isXIType(next, m_xiOpCode, XI_TouchUpdate)) { ++ xXIDeviceEvent *xiDeviceNextEvent = reinterpret_cast(next); ++ if (id == xiDeviceNextEvent->detail % INT_MAX) ++ return true; ++ } ++ } ++ return false; ++ } ++#endif ++ return false; ++ } ++#endif ++ if (responseType == XCB_CONFIGURE_NOTIFY) { ++ // compress multiple configure notify events for the same window ++ for (int j = nextIndex; j < eventqueue->size(); ++j) { ++ xcb_generic_event_t *next = eventqueue->at(j); ++ if (isValid(next) && next->response_type == XCB_CONFIGURE_NOTIFY ++ && ((xcb_configure_notify_event_t *)next)->event == ((xcb_configure_notify_event_t*)event)->event) ++ { ++ return true; ++ } ++ } ++ return false; ++ } ++ ++ return false; ++} ++ + void QXcbConnection::processXcbEvents() + { + int connection_error = xcb_connection_has_error(xcb_connection()); +@@ -1477,61 +1594,39 @@ + + QXcbEventArray *eventqueue = m_reader->lock(); + +- for(int i = 0; i < eventqueue->size(); ++i) { ++ for (int i = 0; i < eventqueue->size(); ++i) { + xcb_generic_event_t *event = eventqueue->at(i); + if (!event) + continue; + QScopedPointer eventGuard(event); + (*eventqueue)[i] = 0; + +- uint response_type = event->response_type & ~0x80; +- +- if (!response_type) { ++ if (!(event->response_type & ~0x80)) { + handleXcbError((xcb_generic_error_t *)event); +- } else { +- if (response_type == XCB_MOTION_NOTIFY) { +- // compress multiple motion notify events in a row +- // to avoid swamping the event queue +- xcb_generic_event_t *next = eventqueue->value(i+1, 0); +- if (next && (next->response_type & ~0x80) == XCB_MOTION_NOTIFY) +- continue; +- } ++ continue; ++ } + +- if (response_type == XCB_CONFIGURE_NOTIFY) { +- // compress multiple configure notify events for the same window +- bool found = false; +- for (int j = i; j < eventqueue->size(); ++j) { +- xcb_generic_event_t *other = eventqueue->at(j); +- if (other && (other->response_type & ~0x80) == XCB_CONFIGURE_NOTIFY +- && ((xcb_configure_notify_event_t *)other)->event == ((xcb_configure_notify_event_t *)event)->event) +- { +- found = true; +- break; +- } +- } +- if (found) +- continue; +- } ++ if (compressEvent(event, i, eventqueue)) ++ continue; + +- bool accepted = false; +- if (clipboard()->processIncr()) +- clipboard()->incrTransactionPeeker(event, accepted); +- if (accepted) +- continue; ++ bool accepted = false; ++ if (clipboard()->processIncr()) ++ clipboard()->incrTransactionPeeker(event, accepted); ++ if (accepted) ++ continue; + +- QVector::iterator it = m_peekFuncs.begin(); +- while (it != m_peekFuncs.end()) { +- // These callbacks return true if the event is what they were +- // waiting for, remove them from the list in that case. +- if ((*it)(this, event)) +- it = m_peekFuncs.erase(it); +- else +- ++it; +- } +- m_reader->unlock(); +- handleXcbEvent(event); +- m_reader->lock(); ++ QVector::iterator it = m_peekFuncs.begin(); ++ while (it != m_peekFuncs.end()) { ++ // These callbacks return true if the event is what they were ++ // waiting for, remove them from the list in that case. ++ if ((*it)(this, event)) ++ it = m_peekFuncs.erase(it); ++ else ++ ++it; + } ++ m_reader->unlock(); ++ handleXcbEvent(event); ++ m_reader->lock(); + } + + eventqueue->clear(); +@@ -2073,34 +2168,13 @@ + return true; + } + +-// Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed: +-// - "pad0" became "extension" +-// - "pad1" and "pad" became "pad0" +-// New and old version of this struct share the following fields: +-// NOTE: API might change again in the next release of xcb in which case this comment will +-// need to be updated to reflect the reality. +-typedef struct qt_xcb_ge_event_t { +- uint8_t response_type; +- uint8_t extension; +- uint16_t sequence; +- uint32_t length; +- uint16_t event_type; +-} qt_xcb_ge_event_t; +- +-bool QXcbConnection::xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *ev, int opCode) ++void QXcbConnection::xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event) + { +- qt_xcb_ge_event_t *event = (qt_xcb_ge_event_t *)ev; +- // xGenericEvent has "extension" on the second byte, the same is true for xcb_ge_event_t starting from +- // the xcb version 1.9.3, prior to that it was called "pad0". +- if (event->extension == opCode) { +- // xcb event structs contain stuff that wasn't on the wire, the full_sequence field +- // adds an extra 4 bytes and generic events cookie data is on the wire right after the standard 32 bytes. +- // Move this data back to have the same layout in memory as it was on the wire +- // and allow casting, overwriting the full_sequence field. +- memmove((char*) event + 32, (char*) event + 36, event->length * 4); +- return true; +- } +- return false; ++ // xcb event structs contain stuff that wasn't on the wire, the full_sequence field ++ // adds an extra 4 bytes and generic events cookie data is on the wire right after the standard 32 bytes. ++ // Move this data back to have the same layout in memory as it was on the wire ++ // and allow casting, overwriting the full_sequence field. ++ memmove((char*) event + 32, (char*) event + 36, event->length * 4); + } + #endif // defined(XCB_USE_XINPUT2) + +--- a/src/plugins/platforms/xcb/qxcbconnection.h ++++ b/src/plugins/platforms/xcb/qxcbconnection.h +@@ -517,6 +517,7 @@ + QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output); + QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow); + void updateScreens(const xcb_randr_notify_event_t *event); ++ bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; + bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); + void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); + QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, +@@ -576,7 +577,7 @@ + QHash m_scrollingDevices; + + static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); +- static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode); ++ static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); + #endif + + xcb_connection_t *m_connection; +--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp ++++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +@@ -459,82 +459,81 @@ + + void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event) + { +- if (xi2PrepareXIGenericDeviceEvent(event, m_xiOpCode)) { +- xXIGenericDeviceEvent *xiEvent = reinterpret_cast(event); +- int sourceDeviceId = xiEvent->deviceid; // may be the master id +- xXIDeviceEvent *xiDeviceEvent = 0; +- QXcbWindowEventListener *eventListener = 0; +- +- switch (xiEvent->evtype) { +- case XI_ButtonPress: +- case XI_ButtonRelease: +- case XI_Motion: ++ xi2PrepareXIGenericDeviceEvent(event); ++ xXIGenericDeviceEvent *xiEvent = reinterpret_cast(event); ++ int sourceDeviceId = xiEvent->deviceid; // may be the master id ++ xXIDeviceEvent *xiDeviceEvent = 0; ++ QXcbWindowEventListener *eventListener = 0; ++ ++ switch (xiEvent->evtype) { ++ case XI_ButtonPress: ++ case XI_ButtonRelease: ++ case XI_Motion: + #ifdef XCB_USE_XINPUT22 +- case XI_TouchBegin: +- case XI_TouchUpdate: +- case XI_TouchEnd: ++ case XI_TouchBegin: ++ case XI_TouchUpdate: ++ case XI_TouchEnd: + #endif +- { +- xiDeviceEvent = reinterpret_cast(event); +- eventListener = windowEventListenerFromId(xiDeviceEvent->event); +- if (eventListener) { +- long result = 0; +- if (eventListener->handleGenericEvent(reinterpret_cast(event), &result)) +- return; +- } +- sourceDeviceId = xiDeviceEvent->sourceid; // use the actual device id instead of the master +- break; +- } +- case XI_HierarchyChanged: +- xi2HandleHierachyEvent(xiEvent); +- return; +- case XI_DeviceChanged: +- xi2HandleDeviceChangedEvent(xiEvent); +- return; +- default: +- break; ++ { ++ xiDeviceEvent = reinterpret_cast(event); ++ eventListener = windowEventListenerFromId(xiDeviceEvent->event); ++ if (eventListener) { ++ long result = 0; ++ if (eventListener->handleGenericEvent(reinterpret_cast(event), &result)) ++ return; + } ++ sourceDeviceId = xiDeviceEvent->sourceid; // use the actual device id instead of the master ++ break; ++ } ++ case XI_HierarchyChanged: ++ xi2HandleHierachyEvent(xiEvent); ++ return; ++ case XI_DeviceChanged: ++ xi2HandleDeviceChangedEvent(xiEvent); ++ return; ++ default: ++ break; ++ } + + #ifndef QT_NO_TABLETEVENT +- for (int i = 0; i < m_tabletData.count(); ++i) { +- if (m_tabletData.at(i).deviceId == sourceDeviceId) { +- if (xi2HandleTabletEvent(xiEvent, &m_tabletData[i], eventListener)) +- return; +- } ++ for (int i = 0; i < m_tabletData.count(); ++i) { ++ if (m_tabletData.at(i).deviceId == sourceDeviceId) { ++ if (xi2HandleTabletEvent(xiEvent, &m_tabletData[i], eventListener)) ++ return; + } ++ } + #endif // QT_NO_TABLETEVENT + + #ifdef XCB_USE_XINPUT21 +- QHash::iterator device = m_scrollingDevices.find(sourceDeviceId); +- if (device != m_scrollingDevices.end()) +- xi2HandleScrollEvent(xiEvent, device.value()); ++ QHash::iterator device = m_scrollingDevices.find(sourceDeviceId); ++ if (device != m_scrollingDevices.end()) ++ xi2HandleScrollEvent(xiEvent, device.value()); + #endif // XCB_USE_XINPUT21 + + #ifdef XCB_USE_XINPUT22 +- if (xiDeviceEvent) { +- switch (xiDeviceEvent->evtype) { +- case XI_ButtonPress: +- case XI_ButtonRelease: +- case XI_Motion: +- if (xi2MouseEvents() && eventListener && !(xiDeviceEvent->flags & XIPointerEmulated)) +- eventListener->handleXIMouseEvent(event); +- break; +- +- case XI_TouchBegin: +- case XI_TouchUpdate: +- case XI_TouchEnd: +- if (Q_UNLIKELY(lcQpaXInput().isDebugEnabled())) +- qCDebug(lcQpaXInput, "XI2 touch event type %d seq %d detail %d pos %6.1f, %6.1f root pos %6.1f, %6.1f on window %x", +- event->event_type, xiDeviceEvent->sequenceNumber, xiDeviceEvent->detail, +- fixed1616ToReal(xiDeviceEvent->event_x), fixed1616ToReal(xiDeviceEvent->event_y), +- fixed1616ToReal(xiDeviceEvent->root_x), fixed1616ToReal(xiDeviceEvent->root_y),xiDeviceEvent->event); +- if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) +- xi2ProcessTouch(xiDeviceEvent, platformWindow); +- break; +- } ++ if (xiDeviceEvent) { ++ switch (xiDeviceEvent->evtype) { ++ case XI_ButtonPress: ++ case XI_ButtonRelease: ++ case XI_Motion: ++ if (xi2MouseEvents() && eventListener && !(xiDeviceEvent->flags & XIPointerEmulated)) ++ eventListener->handleXIMouseEvent(event); ++ break; ++ ++ case XI_TouchBegin: ++ case XI_TouchUpdate: ++ case XI_TouchEnd: ++ if (Q_UNLIKELY(lcQpaXInput().isDebugEnabled())) ++ qCDebug(lcQpaXInput, "XI2 touch event type %d seq %d detail %d pos %6.1f, %6.1f root pos %6.1f, %6.1f on window %x", ++ event->event_type, xiDeviceEvent->sequenceNumber, xiDeviceEvent->detail, ++ fixed1616ToReal(xiDeviceEvent->event_x), fixed1616ToReal(xiDeviceEvent->event_y), ++ fixed1616ToReal(xiDeviceEvent->root_x), fixed1616ToReal(xiDeviceEvent->root_y),xiDeviceEvent->event); ++ if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) ++ xi2ProcessTouch(xiDeviceEvent, platformWindow); ++ break; + } +-#endif // XCB_USE_XINPUT22 + } ++#endif // XCB_USE_XINPUT22 + } + + #ifdef XCB_USE_XINPUT22