summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-04-07 12:54:11 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-04-07 12:54:11 +0100
commitd8645cd148949c7ceaf516c1c9af0c2a88810e67 (patch)
tree698441f7a8c03636af47adc8ac419548781769ae /src
parentc9f7afbf782304fef1ca629a278ce8ef35fc1e3d (diff)
internal: release buttons on unmap
Diffstat (limited to 'src')
-rw-r--r--src/events/Layers.cpp2
-rw-r--r--src/events/Popups.cpp3
-rw-r--r--src/events/Windows.cpp2
-rw-r--r--src/helpers/SubsurfaceTree.cpp3
4 files changed, 10 insertions, 0 deletions
diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp
index a7135953..ff31355e 100644
--- a/src/events/Layers.cpp
+++ b/src/events/Layers.cpp
@@ -218,6 +218,8 @@ void Events::listener_unmapLayerSurface(void* owner, void* data) {
// refocus if needed
if (WASLASTFOCUS) {
+ g_pInputManager->releaseAllMouseButtons();
+
Vector2D surfaceCoords;
SLayerSurface* pFoundLayerSurface = nullptr;
wlr_surface* foundSurface = nullptr;
diff --git a/src/events/Popups.cpp b/src/events/Popups.cpp
index b56d0792..2649abce 100644
--- a/src/events/Popups.cpp
+++ b/src/events/Popups.cpp
@@ -173,6 +173,9 @@ void Events::listener_unmapPopupXDG(void* owner, void* data) {
ASSERT(PPOPUP);
+ if (PPOPUP->popup->base->surface == g_pCompositor->m_pLastFocus)
+ g_pInputManager->releaseAllMouseButtons();
+
SubsurfaceTree::destroySurfaceTree(PPOPUP->pSurfaceTree);
int lx = 0, ly = 0;
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 95de2305..ca5d88c6 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -637,6 +637,8 @@ void Events::listener_unmapWindow(void* owner, void* data) {
wasLastWindow = true;
g_pCompositor->m_pLastWindow = nullptr;
g_pCompositor->m_pLastFocus = nullptr;
+
+ g_pInputManager->releaseAllMouseButtons();
}
PWINDOW->m_bMappedX11 = false;
diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp
index 3d0ef32a..e6915525 100644
--- a/src/helpers/SubsurfaceTree.cpp
+++ b/src/helpers/SubsurfaceTree.cpp
@@ -184,6 +184,9 @@ void Events::listener_unmapSubsurface(void* owner, void* data) {
Debug::log(LOG, "Subsurface %x unmapped", subsurface);
+ if (subsurface->pSubsurface->surface == g_pCompositor->m_pLastFocus)
+ g_pInputManager->releaseAllMouseButtons();
+
if (subsurface->pChild) {
const auto PNODE = subsurface->pChild;