summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2022-11-15 10:39:05 +0000
committervaxerski <vaxry@vaxry.net>2022-11-15 10:39:05 +0000
commitd5eafe192649b290fd587b41f772887058f7418b (patch)
tree3883098e3303cc3094ea7b66834d45a9c1dcaa2e /src/managers/input/InputManager.cpp
parente2da4ff257646ba892ba1c0b01f3f28999e22430 (diff)
set cursor to hand1 when moving a window
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 93e83035..c95fd910 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -339,6 +339,10 @@ void CInputManager::processMouseRequest(wlr_seat_pointer_request_set_cursor_even
g_pHyprRenderer->m_bWindowRequestedCursorHide = false;
}
+ if (m_bCursorImageOverriden) {
+ return;
+ }
+
if (m_ecbClickBehavior == CLICKMODE_KILL) {
wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "crosshair", g_pCompositor->m_sWLRCursor);
return;
@@ -1184,3 +1188,17 @@ void CInputManager::newSwitch(wlr_input_device* pDevice) {
void CInputManager::destroySwitch(SSwitchDevice* pDevice) {
m_lSwitches.remove(*pDevice);
}
+
+void CInputManager::setCursorImageUntilUnset(std::string name) {
+ wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, name.c_str(), g_pCompositor->m_sWLRCursor);
+ m_bCursorImageOverriden = true;
+}
+
+void CInputManager::unsetCursorImage() {
+ if (!m_bCursorImageOverriden)
+ return;
+
+ m_bCursorImageOverriden = false;
+ if (!g_pHyprRenderer->m_bWindowRequestedCursorHide)
+ wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "left_ptr", g_pCompositor->m_sWLRCursor);
+}