diff options
| author | vaxerski <vaxry@vaxry.net> | 2022-08-06 22:26:32 +0200 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2022-08-06 22:26:32 +0200 |
| commit | 9564a4cd127d2d24324fc8a9adb6096960248ec8 (patch) | |
| tree | b093268a515be1b0ffdda359055e914c31a784dd /src/managers | |
| parent | 64e80991ca335c4ef7da736bb5582747caca284a (diff) | |
added misc:always_follow_on_dnd
Diffstat (limited to 'src/managers')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 15 | ||||
| -rw-r--r-- | src/managers/input/InputManager.hpp | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index cf381cbd..ed7623d6 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -29,7 +29,8 @@ void CInputManager::onMouseWarp(wlr_pointer_motion_absolute_event* e) { void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { static auto *const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue; - static auto* const PMOUSEDPMS = &g_pConfigManager->getConfigValuePtr("misc:mouse_move_enables_dpms")->intValue; + static auto *const PMOUSEDPMS = &g_pConfigManager->getConfigValuePtr("misc:mouse_move_enables_dpms")->intValue; + static auto *const PFOLLOWONDND = &g_pConfigManager->getConfigValuePtr("misc:always_follow_on_dnd")->intValue; if (!g_pCompositor->m_bReadyToProcess) return; @@ -246,6 +247,10 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y); } + if (*PFOLLOWONDND && m_sDrag.dragIcon) { + wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y); + } + wlr_seat_pointer_notify_motion(g_pCompositor->m_sSeat.seat, time, surfaceLocal.x, surfaceLocal.y); return; // don't enter any new surfaces } else { @@ -724,16 +729,16 @@ void CInputManager::refocus() { } void CInputManager::updateDragIcon() { - if (!g_pInputManager->m_sDrag.dragIcon) + if (!m_sDrag.dragIcon) return; - switch (g_pInputManager->m_sDrag.dragIcon->drag->grab_type) { + switch (m_sDrag.dragIcon->drag->grab_type) { case WLR_DRAG_GRAB_KEYBOARD: break; case WLR_DRAG_GRAB_KEYBOARD_POINTER: { - wlr_box box = {g_pInputManager->m_sDrag.pos.x - 2, g_pInputManager->m_sDrag.pos.y - 2, g_pInputManager->m_sDrag.dragIcon->surface->current.width + 4, g_pInputManager->m_sDrag.dragIcon->surface->current.height + 4}; + wlr_box box = {m_sDrag.pos.x - 2, m_sDrag.pos.y - 2, m_sDrag.dragIcon->surface->current.width + 4, m_sDrag.dragIcon->surface->current.height + 4}; g_pHyprRenderer->damageBox(&box); - g_pInputManager->m_sDrag.pos = g_pInputManager->getMouseCoordsInternal(); + m_sDrag.pos = getMouseCoordsInternal(); break; } default: diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp index ed3940d6..cb0bd722 100644 --- a/src/managers/input/InputManager.hpp +++ b/src/managers/input/InputManager.hpp @@ -84,6 +84,8 @@ public: // for shared mods uint32_t accumulateModsFromAllKBs(); + CWindow* m_pFollowOnDnDBegin = nullptr; + private: // for click behavior override |
