summaryrefslogtreecommitdiff
path: root/src/managers/InputManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-31 17:25:23 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-31 17:25:23 +0200
commit3e614f2c1e0005f34af4f216ad315b662623fcf2 (patch)
treef518cd5b6d807e641d9aeb0f08776e9d709f79ec /src/managers/InputManager.cpp
parent2ca834479ffbd6f2162f535b1548360e837d073e (diff)
Draw the drag icon
Diffstat (limited to 'src/managers/InputManager.cpp')
-rw-r--r--src/managers/InputManager.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp
index 0718bfcc..10b1ad95 100644
--- a/src/managers/InputManager.cpp
+++ b/src/managers/InputManager.cpp
@@ -20,11 +20,18 @@ void CInputManager::onMouseWarp(wlr_pointer_motion_absolute_event* e) {
void CInputManager::mouseMoveUnified(uint32_t time) {
+ // update stuff
+ updateDragIcon();
+
+
+ // focus
wlr_surface* foundSurface = nullptr;
Vector2D mouseCoords = getMouseCoordsInternal();
+
const auto PMONITOR = g_pCompositor->getMonitorFromCursor();
if (PMONITOR)
g_pCompositor->m_pLastMonitor = PMONITOR;
+
Vector2D surfaceCoords;
Vector2D surfacePos = Vector2D(-1337, -1337);
@@ -255,4 +262,19 @@ void CInputManager::onKeyboardMod(void* data, SKeyboard* pKeyboard) {
void CInputManager::refocus() {
mouseMoveUnified(0);
+}
+
+void CInputManager::updateDragIcon() {
+ if (!g_pInputManager->m_sDrag.dragIcon)
+ return;
+
+ switch (g_pInputManager->m_sDrag.dragIcon->drag->grab_type) {
+ case WLR_DRAG_GRAB_KEYBOARD:
+ break;
+ case WLR_DRAG_GRAB_KEYBOARD_POINTER:
+ g_pInputManager->m_sDrag.pos = g_pInputManager->getMouseCoordsInternal();
+ break;
+ default:
+ break;
+ }
} \ No newline at end of file