diff options
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. |