Don't block interactive moves by sync requests

The compositor doesn't need to synchronize with the client when moving
windows, except cases like unmaximizing the window. It's needed only
when resizing to avoid overwhelming the client with configure notify events.
This commit is contained in:
Vlad Zahorodnii 2024-03-10 14:11:36 +02:00
parent 93326f3e50
commit 670c71f11e
4 changed files with 13 additions and 15 deletions

View file

@ -1378,10 +1378,6 @@ void Window::updateInteractiveMoveResize(const QPointF &currentGlobalCursor)
void Window::handleInteractiveMoveResize(const QPointF &local, const QPointF &global)
{
if (isWaitingForInteractiveMoveResizeSync()) {
return; // we're still waiting for the client or the timeout
}
const Gravity gravity = interactiveMoveResizeGravity();
if ((gravity == Gravity::None && !isMovableAcrossScreens())
|| (gravity != Gravity::None && (isShade() || !isResizable()))) {
@ -1407,17 +1403,19 @@ void Window::handleInteractiveMoveResize(const QPointF &local, const QPointF &gl
setShade(ShadeNone);
}
if (isInteractiveResize()) {
if (m_tile && m_tile->supportsResizeGravity(gravity)) {
m_tile->resizeFromGravity(gravity, global.x(), global.y());
return;
}
}
const QRectF currentMoveResizeGeom = moveResizeGeometry();
QRectF nextMoveResizeGeom = currentMoveResizeGeom;
if (isInteractiveResize()) {
if (isWaitingForInteractiveResizeSync()) {
return; // we're still waiting for the client or the timeout
}
if (m_tile && m_tile->supportsResizeGravity(gravity)) {
m_tile->resizeFromGravity(gravity, global.x(), global.y());
return;
}
nextMoveResizeGeom = nextInteractiveResizeGeometry(global);
if (nextMoveResizeGeom != currentMoveResizeGeom) {
doInteractiveResizeSync(nextMoveResizeGeom);
@ -2470,7 +2468,7 @@ void Window::doFinishInteractiveMoveResize()
{
}
bool Window::isWaitingForInteractiveMoveResizeSync() const
bool Window::isWaitingForInteractiveResizeSync() const
{
return false;
}

View file

@ -1667,7 +1667,7 @@ protected:
* Whether a sync request is still pending.
* Default implementation returns @c false.
*/
virtual bool isWaitingForInteractiveMoveResizeSync() const;
virtual bool isWaitingForInteractiveResizeSync() const;
/**
* Called during handling a resize. Implementing subclasses can use this
* method to perform windowing system specific syncing.

View file

@ -4753,7 +4753,7 @@ void X11Window::leaveInteractiveMoveResize()
Window::leaveInteractiveMoveResize();
}
bool X11Window::isWaitingForInteractiveMoveResizeSync() const
bool X11Window::isWaitingForInteractiveResizeSync() const
{
return m_syncRequest.isPending && m_syncRequest.interactiveResize;
}

View file

@ -344,7 +344,7 @@ protected:
void doSetHiddenByShowDesktop() override;
bool belongsToDesktop() const override;
bool doStartInteractiveMoveResize() override;
bool isWaitingForInteractiveMoveResizeSync() const override;
bool isWaitingForInteractiveResizeSync() const override;
void doInteractiveResizeSync(const QRectF &rect) override;
QSizeF resizeIncrements() const override;
bool acceptsFocus() const override;