diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-08-30 13:42:17 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-08-30 13:42:17 +0200 |
| commit | 28a90d6055f7b616c611c839967765f6536a7cd9 (patch) | |
| tree | e49db2e0022c1f1c893889155c1d7a943c33b970 /src/managers/input/InputManager.cpp | |
| parent | 32f4059b37cde3def606127d843f143380bc2048 (diff) | |
input: warp in unconstrainMouse
XWayland coord translation would fuck up if we did this in destroyConstraint
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 80869a77..679c1bca 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -787,7 +787,7 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { if (FILE* const KEYMAPFILE = fopen(path.c_str(), "r"); !KEYMAPFILE) Debug::log(ERR, "Cannot open input:kb_file= file for reading"); else { - KEYMAP = xkb_keymap_new_from_file(CONTEXT, KEYMAPFILE, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS); + KEYMAP = xkb_keymap_new_from_file(CONTEXT, KEYMAPFILE, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS); fclose(KEYMAPFILE); } } @@ -1231,6 +1231,12 @@ void CInputManager::unconstrainMouse() { g_pXWaylandManager->activateSurface(CONSTRAINTWINDOW->m_pWLSurface.wlr(), false); wlr_pointer_constraint_v1_send_deactivated(g_pCompositor->m_sSeat.mouse->currentConstraint); + + const auto PCONSTRAINT = constraintFromWlr(g_pCompositor->m_sSeat.mouse->currentConstraint); + warpMouseToConstraintMiddle(PCONSTRAINT); + PCONSTRAINT->hintSet = false; + PCONSTRAINT->positionHint = {-1, -1}; + g_pCompositor->m_sSeat.mouse->constraintActive = false; // TODO: its better to somehow detect the workspace... |
