summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-02-17 16:02:17 +0000
committerVaxry <vaxry@vaxry.net>2024-02-17 16:02:17 +0000
commit294e51a857d158ce0b03c5fd752bbd05e67f6bc9 (patch)
tree963e5a4dd6432cdecdc4ad19491b65d469419443 /src
parentcdcc5aba06f20005842cf966b23af50456dc7142 (diff)
input: refocus on completed drags
Diffstat (limited to 'src')
-rw-r--r--src/events/Misc.cpp2
-rw-r--r--src/managers/input/InputManager.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/events/Misc.cpp b/src/events/Misc.cpp
index 5e8025a1..b77cf038 100644
--- a/src/events/Misc.cpp
+++ b/src/events/Misc.cpp
@@ -128,6 +128,8 @@ void Events::listener_destroyDrag(void* owner, void* data) {
g_pInputManager->m_sDrag.drag = nullptr;
g_pInputManager->m_sDrag.dragIcon = nullptr;
g_pInputManager->m_sDrag.hyprListener_destroy.removeCallback();
+
+ g_pCompositor->focusWindow(g_pCompositor->m_pLastWindow, g_pCompositor->m_pLastWindow ? g_pXWaylandManager->getWindowSurface(g_pCompositor->m_pLastWindow) : nullptr);
}
void Events::listener_mapDragIcon(void* owner, void* data) {
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index d45b1dc9..dab83b1d 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -423,7 +423,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
return; // don't enter any new surfaces
} else {
if (allowKeyboardRefocus && ((FOLLOWMOUSE != 3 && (*PMOUSEREFOCUS || m_pLastMouseFocus != pFoundWindow)) || refocus)) {
- if (m_pLastMouseFocus != pFoundWindow || g_pCompositor->m_pLastWindow != pFoundWindow || g_pCompositor->m_pLastFocus != foundSurface) {
+ if (m_pLastMouseFocus != pFoundWindow || g_pCompositor->m_pLastWindow != pFoundWindow || g_pCompositor->m_pLastFocus != foundSurface || refocus) {
m_pLastMouseFocus = pFoundWindow;
// TODO: this looks wrong. When over a popup, it constantly is switching.