From ee41e9b6e7c2b558c4857edd4fbf2548e792a9be Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sat, 30 Oct 2021 13:43:08 +0300 Subject: [PATCH] Fix Workspace::inUpdateClientArea() with auto-hide panels If there's an auto-hide panel, m_oldRestrictedAreas will be empty, which will break AbstractClient::checkWorkspacePosition(). --- src/workspace.cpp | 4 +++- src/workspace.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/workspace.cpp b/src/workspace.cpp index 1698ad7fcb..1bc7964f7a 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -2254,6 +2254,7 @@ void Workspace::updateClientArea() m_workAreas = workAreas; m_screenAreas = screenAreas; + m_inUpdateClientArea = true; m_oldRestrictedAreas = m_restrictedAreas; m_restrictedAreas = restrictedAreas; @@ -2276,6 +2277,7 @@ void Workspace::updateClientArea() } m_oldRestrictedAreas.clear(); // reset, no longer valid or needed + m_inUpdateClientArea = false; } } @@ -2397,7 +2399,7 @@ QRegion Workspace::restrictedMoveArea(const VirtualDesktop *desktop, StrutAreas bool Workspace::inUpdateClientArea() const { - return !m_oldRestrictedAreas.isEmpty(); + return m_inUpdateClientArea; } QRegion Workspace::previousRestrictedMoveArea(const VirtualDesktop *desktop, StrutAreas areas) const diff --git a/src/workspace.h b/src/workspace.h index d3bc39f63e..8d61a0921b 100644 --- a/src/workspace.h +++ b/src/workspace.h @@ -673,6 +673,7 @@ private: QHash m_oldScreenGeometries; QSize olddisplaysize; // previous sizes od displayWidth()/displayHeight() QHash m_oldRestrictedAreas; + bool m_inUpdateClientArea = false; int set_active_client_recursion; int block_stacking_updates; // When > 0, stacking updates are temporarily disabled