summaryrefslogtreecommitdiff
path: root/src/managers/input
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2023-05-31 20:59:38 +0200
committervaxerski <vaxry@vaxry.net>2023-05-31 20:59:38 +0200
commitbaf81cdc5d595b97ea9d1561315f7982720124a1 (patch)
treef43bd125a744ae6a77bd04ffc606258be4d2e794 /src/managers/input
parent9f72d508ae41e8de31aebcc6d5407b063af6ed09 (diff)
input: force focus on movefocus
Diffstat (limited to 'src/managers/input')
-rw-r--r--src/managers/input/InputManager.cpp6
-rw-r--r--src/managers/input/InputManager.hpp16
2 files changed, 14 insertions, 8 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 79b71c95..9f72603f 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -98,6 +98,12 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
if (*PZOOMFACTOR != 1.f)
g_pHyprRenderer->damageMonitor(PMONITOR);
+ if (m_pForcedFocus) {
+ pFoundWindow = m_pForcedFocus;
+ surfacePos = pFoundWindow->m_vRealPosition.vec();
+ foundSurface = m_pForcedFocus->m_pWLSurface.wlr();
+ }
+
// constraints
// All constraints TODO: multiple mice?
if (g_pCompositor->m_sSeat.mouse && g_pCompositor->m_sSeat.mouse->currentConstraint && !g_pCompositor->m_sSeat.exclusiveClient && !g_pSessionLockManager->isSessionLocked()) {
diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp
index 5cc3c6a6..5c496117 100644
--- a/src/managers/input/InputManager.hpp
+++ b/src/managers/input/InputManager.hpp
@@ -7,21 +7,18 @@
#include "../../helpers/Timer.hpp"
#include "InputMethodRelay.hpp"
-enum eClickBehaviorMode
-{
+enum eClickBehaviorMode {
CLICKMODE_DEFAULT = 0,
CLICKMODE_KILL
};
-enum eMouseBindMode
-{
+enum eMouseBindMode {
MBIND_INVALID = -1,
MBIND_MOVE = 0,
MBIND_RESIZE
};
-enum eBorderIconDirection
-{
+enum eBorderIconDirection {
BORDERICON_NONE,
BORDERICON_UP,
BORDERICON_DOWN,
@@ -111,8 +108,11 @@ class CInputManager {
STouchData m_sTouchData;
// for dragging floating windows
- CWindow* currentlyDraggedWindow = nullptr;
- eMouseBindMode dragMode = MBIND_INVALID;
+ CWindow* currentlyDraggedWindow = nullptr;
+ eMouseBindMode dragMode = MBIND_INVALID;
+
+ // for refocus to be forced
+ CWindow* m_pForcedFocus = nullptr;
SDrag m_sDrag;