summaryrefslogtreecommitdiff
path: root/src/protocols/core/DataDevice.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-10-31 00:14:08 +0000
committerGitHub <noreply@github.com>2025-10-31 00:14:08 +0000
commit5e6cec962c780956177e56355ffc1d64cc5f83ca (patch)
tree9277452bb7202094e8a2a2cac3acea7aaa964772 /src/protocols/core/DataDevice.cpp
parent6ade4d58cab67e18aa758ef664e36421cab4d8b2 (diff)
cursor: refactor override handling (#12166)
much cleaner and more reliable. Should fix https://github.com/hyprwm/Hyprland/issues/12088
Diffstat (limited to 'src/protocols/core/DataDevice.cpp')
-rw-r--r--src/protocols/core/DataDevice.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp
index bf17086e..b3239cf1 100644
--- a/src/protocols/core/DataDevice.cpp
+++ b/src/protocols/core/DataDevice.cpp
@@ -11,6 +11,7 @@
#include "../../xwayland/Server.hpp"
#include "../../managers/input/InputManager.hpp"
#include "../../managers/HookSystemManager.hpp"
+#include "../../managers/cursor/CursorShapeOverrideController.hpp"
#include "../../helpers/Monitor.hpp"
#include "../../render/Renderer.hpp"
#include "../../xwayland/Dnd.hpp"
@@ -553,7 +554,7 @@ void CWLDataDeviceProtocol::initiateDrag(WP<CWLDataSourceResource> currentSource
abortDrag();
}
- g_pInputManager->setCursorImageUntilUnset("grabbing");
+ Cursor::overrideController->setOverride("grabbing", Cursor::CURSOR_OVERRIDE_DND);
m_dnd.overriddenCursor = true;
LOGM(LOG, "initiateDrag: source {:x}, surface: {:x}, origin: {:x}", (uintptr_t)currentSource.get(), (uintptr_t)dragSurface, (uintptr_t)origin);
@@ -734,7 +735,7 @@ void CWLDataDeviceProtocol::dropDrag() {
if (m_dnd.focusedDevice->getX11()) {
m_dnd.focusedDevice->sendLeave();
if (m_dnd.overriddenCursor)
- g_pInputManager->unsetCursorImage();
+ Cursor::overrideController->unsetOverride(Cursor::CURSOR_OVERRIDE_DND);
m_dnd.overriddenCursor = false;
cleanupDndState(true, true, true);
return;
@@ -743,7 +744,7 @@ void CWLDataDeviceProtocol::dropDrag() {
m_dnd.focusedDevice->sendLeave();
if (m_dnd.overriddenCursor)
- g_pInputManager->unsetCursorImage();
+ Cursor::overrideController->unsetOverride(Cursor::CURSOR_OVERRIDE_DND);
m_dnd.overriddenCursor = false;
cleanupDndState(false, false, false);
}
@@ -784,7 +785,7 @@ void CWLDataDeviceProtocol::abortDrag() {
cleanupDndState(false, false, false);
if (m_dnd.overriddenCursor)
- g_pInputManager->unsetCursorImage();
+ Cursor::overrideController->unsetOverride(Cursor::CURSOR_OVERRIDE_DND);
m_dnd.overriddenCursor = false;
if (!m_dnd.focusedDevice && !m_dnd.currentSource)