From 4ba249eee52ab7ec9e8fdd78af330f15efe27648 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 14 May 2021 08:32:49 +0300 Subject: [PATCH] wayland: Signal about finished move/resize in destroyClient() We need to emit the clientFinishUserMovedResized signal to notify effects such as translucency that the interactive move-resize is finished. Otherwise, the set() animation won't be cancelled and the window will get stuck frozen. BUG: 409376 --- autotests/integration/move_resize_window_test.cpp | 4 ++-- src/internal_client.cpp | 1 + src/xdgshellclient.cpp | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/autotests/integration/move_resize_window_test.cpp b/autotests/integration/move_resize_window_test.cpp index 16ac32915a..54fbbf0bfb 100644 --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -1055,7 +1055,7 @@ void MoveResizeWindowTest::testDestroyMoveClient() shellSurface.reset(); surface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); - QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); + QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); QCOMPARE(workspace()->moveResizeClient(), nullptr); } @@ -1092,7 +1092,7 @@ void MoveResizeWindowTest::testDestroyResizeClient() shellSurface.reset(); surface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); - QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); + QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); QCOMPARE(workspace()->moveResizeClient(), nullptr); } diff --git a/src/internal_client.cpp b/src/internal_client.cpp index d432f77975..35237fffef 100644 --- a/src/internal_client.cpp +++ b/src/internal_client.cpp @@ -346,6 +346,7 @@ void InternalClient::destroyClient() markAsZombie(); if (isMoveResize()) { leaveMoveResize(); + emit clientFinishUserMovedResized(this); } Deleted *deleted = Deleted::create(this); diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp index 323e43cbc9..ac2db6afdb 100644 --- a/src/xdgshellclient.cpp +++ b/src/xdgshellclient.cpp @@ -319,10 +319,11 @@ QRect XdgSurfaceClient::frameRectToBufferRect(const QRect &rect) const void XdgSurfaceClient::destroyClient() { markAsZombie(); - m_configureTimer->stop(); if (isMoveResize()) { leaveMoveResize(); + emit clientFinishUserMovedResized(this); } + m_configureTimer->stop(); cleanTabBox(); Deleted *deleted = Deleted::create(this); emit windowClosed(this, deleted);