diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2018-07-27 11:22:57 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2018-07-31 13:33:14 +0200 |
commit | 23c9d4c98f3c6729b56700edc1d7144b444b16db (patch) | |
tree | 27b20ccbf3c101dbc7bcb1e509882b6c7fc75962 /src/plugins/platforms/xcb/qxcbwindow.cpp | |
parent | f69a5857d115786f44d053e68c36f74526020e82 (diff) | |
parent | 0ef66e98ccf4946a0e4513ab5fc157df0f0aca4e (diff) |
Merge branch '5.11' into dev
Conflicts:
qmake/library/qmakebuiltins.cpp
src/plugins/platforms/windows/qwindowstabletsupport.h
src/plugins/platforms/xcb/qxcbconnection.cpp
src/plugins/platforms/xcb/qxcbconnection.h
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
src/plugins/platforms/xcb/qxcbwindow.cpp
src/widgets/styles/qstylesheetstyle.cpp
tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
Done-With: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I000b0eb3cea2a5c7a99b95732bfdd41507cf916e
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 9e9058e6e9..ed37c6b1f8 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -2569,18 +2569,41 @@ bool QXcbWindow::startSystemMove(const QPoint &pos) bool QXcbWindow::startSystemMoveResize(const QPoint &pos, int corner) { +#if QT_CONFIG(xcb_xinput) const xcb_atom_t moveResize = connection()->atom(QXcbAtom::_NET_WM_MOVERESIZE); if (!connection()->wmSupport()->isSupportedByWM(moveResize)) return false; + const QPoint globalPos = QHighDpi::toNativePixels(window()->mapToGlobal(pos), window()->screen()); -#if QT_CONFIG(xcb_xinput) - if (connection()->startSystemMoveResizeForTouchBegin(m_window, globalPos, corner)) - return true; -#endif - return doStartSystemMoveResize(globalPos, corner); + // ### FIXME QTBUG-53389 + bool startedByTouch = connection()->startSystemMoveResizeForTouchBegin(m_window, globalPos, corner); + if (startedByTouch) { + if (connection()->isUnity() || connection()->isGnome()) { + // These desktops fail to move/resize via _NET_WM_MOVERESIZE (WM bug?). + connection()->abortSystemMoveResizeForTouch(); + return false; + } + // KWin, Openbox, AwesomeWM have been tested to work with _NET_WM_MOVERESIZE. + } else { // Started by mouse press. + if (!connection()->hasXInput2() || connection()->xi2MouseEventsDisabled()) { + // Without XI2 we can't get button press/move/release events. + return false; + } + if (connection()->isUnity()) + return false; // _NET_WM_MOVERESIZE on this WM is bouncy (WM bug?). + + doStartSystemMoveResize(globalPos, corner); + } + + return true; +#else + Q_UNUSED(pos); + Q_UNUSED(corner); + return false; +#endif // xcb_xinput } -bool QXcbWindow::doStartSystemMoveResize(const QPoint &globalPos, int corner) +void QXcbWindow::doStartSystemMoveResize(const QPoint &globalPos, int corner) { const xcb_atom_t moveResize = connection()->atom(QXcbAtom::_NET_WM_MOVERESIZE); xcb_client_message_event_t xev; @@ -2607,7 +2630,6 @@ bool QXcbWindow::doStartSystemMoveResize(const QPoint &globalPos, int corner) xcb_send_event(connection()->xcb_connection(), false, xcbScreen()->root(), XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY, (const char *)&xev); - return true; } // Sends an XEmbed message. |