xcb: Fix build when xinput2 is not available
Fix the #ifdefs.
Amends 3bc0f1724a.
Task-number: QTBUG-68501
Task-number: QTBUG-51385
Task-number: QTBUG-32476
Change-Id: Icc6421fe2e91a3b29bcec8cb1a8a91cb71ae3172
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
bb10
parent
708fa860bc
commit
ad8a7f0c50
|
|
@ -2632,16 +2632,15 @@ bool QXcbWindow::startSystemMove(const QPoint &pos)
|
|||
|
||||
bool QXcbWindow::startSystemMoveResize(const QPoint &pos, int corner)
|
||||
{
|
||||
#if QT_CONFIG(xinput2)
|
||||
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
|
||||
// ### FIXME QTBUG-53389
|
||||
startedByTouch = connection()->startSystemMoveResizeForTouchBegin(m_window, globalPos, corner);
|
||||
#endif
|
||||
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?).
|
||||
|
|
@ -2649,7 +2648,9 @@ bool QXcbWindow::startSystemMoveResize(const QPoint &pos, int corner)
|
|||
return false;
|
||||
}
|
||||
// KWin, Openbox, AwesomeWM have been tested to work with _NET_WM_MOVERESIZE.
|
||||
} else { // Started by mouse press.
|
||||
} else
|
||||
#endif
|
||||
{ // Started by mouse press.
|
||||
if (!connection()->hasXInput2() || connection()->xi2MouseEventsDisabled()) {
|
||||
// Without XI2 we can't get button press/move/release events.
|
||||
return false;
|
||||
|
|
@ -2661,6 +2662,11 @@ bool QXcbWindow::startSystemMoveResize(const QPoint &pos, int corner)
|
|||
}
|
||||
|
||||
return true;
|
||||
#else
|
||||
Q_UNUSED(pos);
|
||||
Q_UNUSED(corner);
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
void QXcbWindow::doStartSystemMoveResize(const QPoint &globalPos, int corner)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue