From 9d6999345e202c785af0f6678986c251e02e4b32 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 2 Jul 2022 20:06:10 +0200 Subject: don't process new focus when cursor constrained --- src/managers/input/InputManager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 9d175fe9..a6358dc1 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -86,6 +86,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { } else { if ((!CONSTRAINTWINDOW->m_bIsX11 && PMONITOR && CONSTRAINTWINDOW->m_iWorkspaceID == PMONITOR->activeWorkspace) || (CONSTRAINTWINDOW->m_bIsX11)) { g_pCompositor->m_sSeat.mouse->constraintActive = true; + didConstraintOnCursor = true; } } } -- cgit v1.2.3 From 0a01ec9926664e20420beee17e7daefc5e11358a Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Sun, 3 Jul 2022 15:51:32 +0300 Subject: Fix non-focused windows on WS change Fixes #298 --- src/managers/input/InputManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index a6358dc1..194592cc 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -39,7 +39,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { Vector2D mouseCoords = getMouseCoordsInternal(); const auto MOUSECOORDSFLOORED = mouseCoords.floor(); - if (MOUSECOORDSFLOORED == m_vLastCursorPosFloored) + if (MOUSECOORDSFLOORED == m_vLastCursorPosFloored && !refocus) return; m_vLastCursorPosFloored = MOUSECOORDSFLOORED; -- cgit v1.2.3 From 01228fbc9c785cd04b903a36f4710f04639f11a8 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 3 Jul 2022 22:54:47 +0200 Subject: fix some bugs --- src/managers/input/InputManager.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 194592cc..13833d18 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -392,6 +392,9 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { ASSERT(pKeyboard); + if (!pKeyboard->keyboard->keyboard) + return; + const auto REPEATRATE = HASCONFIG ? g_pConfigManager->getDeviceInt(pKeyboard->name, "repeat_rate") : g_pConfigManager->getInt("input:repeat_rate"); const auto REPEATDELAY = HASCONFIG ? g_pConfigManager->getDeviceInt(pKeyboard->name, "repeat_delay") : g_pConfigManager->getInt("input:repeat_delay"); -- cgit v1.2.3 From 0d54451c677498ad5c37510d02abc646ea38f8aa Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Jul 2022 11:12:27 +0200 Subject: fix incorrect mouse pos in fullscreen xdg --- src/managers/input/InputManager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 13833d18..387cf306 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -139,6 +139,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { if (!pFoundWindow->m_bIsX11) { foundSurface = g_pCompositor->vectorWindowToSurface(mouseCoords, pFoundWindow, surfaceCoords); + surfacePos = Vector2D(-1337, -1337); } else { foundSurface = g_pXWaylandManager->getWindowSurface(pFoundWindow); surfacePos = pFoundWindow->m_vRealPosition.vec(); -- cgit v1.2.3 From 8d05dddb98e598da6e487b472399d691fc0b7e85 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Jul 2022 14:58:46 +0200 Subject: fix focus on maximized windows with special open --- src/managers/input/InputManager.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 387cf306..b95a507c 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -155,9 +155,18 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { // then windows if (!foundSurface) { - if (PWORKSPACE->m_bHasFullscreenWindow && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) - pFoundWindow = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); - else + if (PWORKSPACE->m_bHasFullscreenWindow && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) { + + if (PMONITOR->specialWorkspaceOpen) { + pFoundWindow = g_pCompositor->vectorToWindowIdeal(mouseCoords); + + if (pFoundWindow && pFoundWindow->m_iWorkspaceID != SPECIAL_WORKSPACE_ID) { + pFoundWindow = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); + } + } else { + pFoundWindow = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); + } + } else pFoundWindow = g_pCompositor->vectorToWindowIdeal(mouseCoords); if (pFoundWindow) { -- cgit v1.2.3 From 75c2a378e3c9368feb57a31710de26decc3da3bc Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 7 Jul 2022 21:47:59 +0200 Subject: unfocus keyboard on refocus null --- src/managers/input/InputManager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index b95a507c..d5febe66 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -28,6 +28,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; + if (!g_pCompositor->m_bReadyToProcess) return; @@ -194,6 +196,12 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { wlr_seat_pointer_clear_focus(g_pCompositor->m_sSeat.seat); + if (refocus) { // if we are forcing a refocus, and we don't find a surface, clear the kb focus too! + g_pCompositor->focusSurface(nullptr); + + g_pCompositor->m_pLastWindow = nullptr; + } + return; } @@ -211,7 +219,6 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { } if (pFoundWindow) { - static auto *const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue; if (*PFOLLOWMOUSE != 1 && !refocus) { if (pFoundWindow != g_pCompositor->m_pLastWindow && g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow) && (g_pCompositor->m_pLastWindow->m_bIsFloating != pFoundWindow->m_bIsFloating)) { // enter if change floating style -- cgit v1.2.3 From cd0a01f4de6e1489caa35bece331c81dbaab2587 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 8 Jul 2022 09:27:17 +0200 Subject: Added binding by keycodes --- src/managers/input/InputManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index d5febe66..bdcddbe1 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -594,7 +594,9 @@ void CInputManager::onKeyboardKey(wlr_keyboard_key_event* e, SKeyboard* pKeyboar bool found = false; if (e->state == WL_KEYBOARD_KEY_STATE_PRESSED) { for (int i = 0; i < syms; ++i) - found = g_pKeybindManager->handleKeybinds(MODS, keysyms[i]) || found; + found = g_pKeybindManager->handleKeybinds(MODS, keysyms[i], 0) || found; + + found = g_pKeybindManager->handleKeybinds(MODS, 0, KEYCODE) || found; } else if (e->state == WL_KEYBOARD_KEY_STATE_RELEASED) { // hee hee } -- cgit v1.2.3 From 92e17f29256af4db05ebd17b9f2d013ee3ca37ab Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 8 Jul 2022 12:27:05 +0200 Subject: added rules to hyprctl devices and fixed rules --- src/managers/input/InputManager.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index bdcddbe1..883b5b5e 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -424,7 +424,7 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { const auto OPTIONS = HASCONFIG ? g_pConfigManager->getDeviceString(pKeyboard->name, "kb_options") : g_pConfigManager->getString("input:kb_options"); try { - if (NUMLOCKON == pKeyboard->numlockOn && REPEATDELAY == pKeyboard->repeatDelay && REPEATRATE == pKeyboard->repeatRate && RULES != "" && RULES == std::string(pKeyboard->currentRules.rules) && MODEL == std::string(pKeyboard->currentRules.model) && LAYOUT == std::string(pKeyboard->currentRules.layout) && VARIANT == std::string(pKeyboard->currentRules.variant) && OPTIONS == std::string(pKeyboard->currentRules.options)) { + if (NUMLOCKON == pKeyboard->numlockOn && REPEATDELAY == pKeyboard->repeatDelay && REPEATRATE == pKeyboard->repeatRate && RULES != "" && RULES == pKeyboard->currentRules.rules && MODEL == pKeyboard->currentRules.model && LAYOUT == pKeyboard->currentRules.layout && VARIANT == pKeyboard->currentRules.variant && OPTIONS == pKeyboard->currentRules.options) { Debug::log(LOG, "Not applying config to keyboard, it did not change."); return; } @@ -446,7 +446,11 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { .variant = VARIANT.c_str(), .options = OPTIONS.c_str()}; - pKeyboard->currentRules = rules; + pKeyboard->currentRules.rules = RULES; + pKeyboard->currentRules.model = MODEL; + pKeyboard->currentRules.variant = VARIANT; + pKeyboard->currentRules.options = OPTIONS; + pKeyboard->currentRules.layout = LAYOUT; const auto CONTEXT = xkb_context_new(XKB_CONTEXT_NO_FLAGS); @@ -463,7 +467,11 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { Debug::log(ERR, "Keyboard layout %s with variant %s (rules: %s, model: %s, options: %s) couldn't have been loaded.", rules.layout, rules.variant, rules.rules, rules.model, rules.options); memset(&rules, 0, sizeof(rules)); - pKeyboard->currentRules = rules; + pKeyboard->currentRules.rules = ""; + pKeyboard->currentRules.model = ""; + pKeyboard->currentRules.variant = ""; + pKeyboard->currentRules.options = ""; + pKeyboard->currentRules.layout = ""; KEYMAP = xkb_keymap_new_from_names(CONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); } -- cgit v1.2.3 From 6f7377f38138af5e41f094fbae90b4f68e94d49b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 9 Jul 2022 23:24:08 +0200 Subject: accumulate mods from all kbs for keybind processing --- src/managers/input/InputManager.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 883b5b5e..c2c154f1 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -595,7 +595,7 @@ void CInputManager::onKeyboardKey(wlr_keyboard_key_event* e, SKeyboard* pKeyboar const xkb_keysym_t* keysyms; int syms = xkb_state_key_get_syms(pKeyboard->keyboard->keyboard->xkb_state, KEYCODE, &keysyms); - const auto MODS = wlr_keyboard_get_modifiers(pKeyboard->keyboard->keyboard); + const auto MODS = accumulateModsFromAllKBs(); wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat); @@ -735,4 +735,15 @@ void CInputManager::updateCapabilities(wlr_input_device* pDev) { } wlr_seat_set_capabilities(g_pCompositor->m_sSeat.seat, m_uiCapabilities); +} + +uint32_t CInputManager::accumulateModsFromAllKBs() { + + uint32_t finalMask = 0; + + for (auto& kb : m_lKeyboards) { + finalMask |= wlr_keyboard_get_modifiers(kb.keyboard->keyboard); + } + + return finalMask; } \ No newline at end of file -- cgit v1.2.3 From ad66c158ba793c424519eaee0a64fb81860f5e3c Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 11 Jul 2022 20:23:16 +0200 Subject: don't refocus on virt ptrs --- src/managers/input/InputManager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index c2c154f1..8f7c25b1 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -38,6 +38,9 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { return; } + if (g_pCompositor->m_sSeat.mouse->virt) + return; // don't refocus on virt + Vector2D mouseCoords = getMouseCoordsInternal(); const auto MOUSECOORDSFLOORED = mouseCoords.floor(); @@ -498,11 +501,12 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { Debug::log(LOG, "Set the keyboard layout to %s and variant to %s for keyboard \"%s\"", rules.layout, rules.variant, pKeyboard->keyboard->name); } -void CInputManager::newMouse(wlr_input_device* mouse) { +void CInputManager::newMouse(wlr_input_device* mouse, bool virt) { m_lMice.emplace_back(); const auto PMOUSE = &m_lMice.back(); PMOUSE->mouse = mouse; + PMOUSE->virt = virt; try { PMOUSE->name = std::string(mouse->name); } catch(std::exception& e) { -- cgit v1.2.3 From b55b6c95f2943b8274974b914abd8ab6696ab36f Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 11 Jul 2022 23:09:35 +0200 Subject: update wlroots dep --- src/managers/input/InputManager.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 8f7c25b1..fd716d58 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -387,8 +387,8 @@ void CInputManager::newKeyboard(wlr_input_device* keyboard) { Debug::log(ERR, "Keyboard had no name???"); // logic error } - PNEWKEYBOARD->hyprListener_keyboardMod.initCallback(&keyboard->keyboard->events.modifiers, &Events::listener_keyboardMod, PNEWKEYBOARD, "Keyboard"); - PNEWKEYBOARD->hyprListener_keyboardKey.initCallback(&keyboard->keyboard->events.key, &Events::listener_keyboardKey, PNEWKEYBOARD, "Keyboard"); + PNEWKEYBOARD->hyprListener_keyboardMod.initCallback(&wlr_keyboard_from_input_device(keyboard)->events.modifiers, &Events::listener_keyboardMod, PNEWKEYBOARD, "Keyboard"); + PNEWKEYBOARD->hyprListener_keyboardKey.initCallback(&wlr_keyboard_from_input_device(keyboard)->events.key, &Events::listener_keyboardKey, PNEWKEYBOARD, "Keyboard"); PNEWKEYBOARD->hyprListener_keyboardDestroy.initCallback(&keyboard->events.destroy, &Events::listener_keyboardDestroy, PNEWKEYBOARD, "Keyboard"); if (m_pActiveKeyboard) @@ -397,7 +397,7 @@ void CInputManager::newKeyboard(wlr_input_device* keyboard) { applyConfigToKeyboard(PNEWKEYBOARD); - wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, keyboard->keyboard); + wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, wlr_keyboard_from_input_device(keyboard)); Debug::log(LOG, "New keyboard created, pointers Hypr: %x and WLR: %x", PNEWKEYBOARD, keyboard); } @@ -412,7 +412,7 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { ASSERT(pKeyboard); - if (!pKeyboard->keyboard->keyboard) + if (!wlr_keyboard_from_input_device(pKeyboard->keyboard)) return; const auto REPEATRATE = HASCONFIG ? g_pConfigManager->getDeviceInt(pKeyboard->name, "repeat_rate") : g_pConfigManager->getInt("input:repeat_rate"); @@ -436,7 +436,7 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { // we can ignore those and just apply } - wlr_keyboard_set_repeat_info(pKeyboard->keyboard->keyboard, std::max(0, REPEATRATE), std::max(0, REPEATDELAY)); + wlr_keyboard_set_repeat_info(wlr_keyboard_from_input_device(pKeyboard->keyboard), std::max(0, REPEATRATE), std::max(0, REPEATDELAY)); pKeyboard->repeatDelay = REPEATDELAY; pKeyboard->repeatRate = REPEATRATE; @@ -479,7 +479,7 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { KEYMAP = xkb_keymap_new_from_names(CONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); } - wlr_keyboard_set_keymap(pKeyboard->keyboard->keyboard, KEYMAP); + wlr_keyboard_set_keymap(wlr_keyboard_from_input_device(pKeyboard->keyboard), KEYMAP); wlr_keyboard_modifiers wlrMods = {0}; @@ -492,7 +492,7 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { } if (wlrMods.locked != 0) { - wlr_keyboard_notify_modifiers(pKeyboard->keyboard->keyboard, 0, 0, wlrMods.locked, 0); + wlr_keyboard_notify_modifiers(wlr_keyboard_from_input_device(pKeyboard->keyboard), 0, 0, wlrMods.locked, 0); } xkb_keymap_unref(KEYMAP); @@ -597,7 +597,7 @@ void CInputManager::onKeyboardKey(wlr_keyboard_key_event* e, SKeyboard* pKeyboar const auto KEYCODE = e->keycode + 8; // Because to xkbcommon it's +8 from libinput const xkb_keysym_t* keysyms; - int syms = xkb_state_key_get_syms(pKeyboard->keyboard->keyboard->xkb_state, KEYCODE, &keysyms); + int syms = xkb_state_key_get_syms(wlr_keyboard_from_input_device(pKeyboard->keyboard)->xkb_state, KEYCODE, &keysyms); const auto MODS = accumulateModsFromAllKBs(); @@ -614,14 +614,14 @@ void CInputManager::onKeyboardKey(wlr_keyboard_key_event* e, SKeyboard* pKeyboar } if (!found) { - wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, pKeyboard->keyboard->keyboard); + wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, wlr_keyboard_from_input_device(pKeyboard->keyboard)); wlr_seat_keyboard_notify_key(g_pCompositor->m_sSeat.seat, e->time_msec, e->keycode, e->state); } } void CInputManager::onKeyboardMod(void* data, SKeyboard* pKeyboard) { - wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, pKeyboard->keyboard->keyboard); - wlr_seat_keyboard_notify_modifiers(g_pCompositor->m_sSeat.seat, &pKeyboard->keyboard->keyboard->modifiers); + wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, wlr_keyboard_from_input_device(pKeyboard->keyboard)); + wlr_seat_keyboard_notify_modifiers(g_pCompositor->m_sSeat.seat, &wlr_keyboard_from_input_device(pKeyboard->keyboard)->modifiers); } void CInputManager::refocus() { @@ -746,7 +746,7 @@ uint32_t CInputManager::accumulateModsFromAllKBs() { uint32_t finalMask = 0; for (auto& kb : m_lKeyboards) { - finalMask |= wlr_keyboard_get_modifiers(kb.keyboard->keyboard); + finalMask |= wlr_keyboard_get_modifiers(wlr_keyboard_from_input_device(kb.keyboard)); } return finalMask; -- cgit v1.2.3 From da83ef7b96fdee7396382712f9f2115ef4664666 Mon Sep 17 00:00:00 2001 From: Mathias Zhang Date: Tue, 12 Jul 2022 19:11:54 +0800 Subject: add config drag_lock for touchpad (#353) * add config drag_lock for touchpad * fix err * Update ConfigManager.cpp --- src/managers/input/InputManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index fd716d58..2735e4e3 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -530,6 +530,11 @@ void CInputManager::newMouse(wlr_input_device* mouse, bool virt) { libinput_device_config_middle_emulation_set_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); } + if ((HASCONFIG ? g_pConfigManager->getDeviceInt(PMOUSE->name, "drag_lock") : g_pConfigManager->getInt("input:touchpad:drag_lock")) == 0) + libinput_device_config_tap_set_drag_lock_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_DRAG_LOCK_DISABLED); + else + libinput_device_config_tap_set_drag_lock_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED); + if (libinput_device_config_tap_get_finger_count(LIBINPUTDEV)) // this is for tapping (like on a laptop) if ((HASCONFIG ? g_pConfigManager->getDeviceInt(PMOUSE->name, "tap-to-click") : g_pConfigManager->getInt("input:touchpad:tap-to-click")) == 1) libinput_device_config_tap_set_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_TAP_ENABLED); @@ -750,4 +755,4 @@ uint32_t CInputManager::accumulateModsFromAllKBs() { } return finalMask; -} \ No newline at end of file +} -- cgit v1.2.3 From c2215e4efbe4e7351b8ccd12341e3c8dfe23cc39 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 13 Jul 2022 18:33:36 +0200 Subject: fix focus on fullscreen and over --- src/managers/input/InputManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 2735e4e3..fae530b9 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -169,7 +169,10 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { pFoundWindow = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); } } else { - pFoundWindow = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); + pFoundWindow = g_pCompositor->vectorToWindowIdeal(mouseCoords); + + if (!(pFoundWindow && pFoundWindow->m_bIsFloating && pFoundWindow->m_bCreatedOverFullscreen)) + pFoundWindow = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); } } else pFoundWindow = g_pCompositor->vectorToWindowIdeal(mouseCoords); -- cgit v1.2.3