diff options
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 50711e75c3..8c096ddc74 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -2635,15 +2635,34 @@ bool QXcbWindow::startSystemMoveResize(const QPoint &pos, int corner) 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()); + bool startedByTouch = false; #ifdef XCB_USE_XINPUT22 - if (connection()->startSystemMoveResizeForTouchBegin(m_window, globalPos, corner)) - return true; + // ### FIXME QTBUG-53389 + startedByTouch = connection()->startSystemMoveResizeForTouchBegin(m_window, globalPos, corner); #endif - return doStartSystemMoveResize(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); + } -bool QXcbWindow::doStartSystemMoveResize(const QPoint &globalPos, int corner) + return true; +} +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; @@ -2670,7 +2689,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. |