From 45a44f969048d232939c6931fe7ab15cf0e85b87 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 24 Jun 2022 22:28:54 +0200 Subject: added noblur --- src/managers/input/Tablets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/managers') diff --git a/src/managers/input/Tablets.cpp b/src/managers/input/Tablets.cpp index c33f021c..4285d06b 100644 --- a/src/managers/input/Tablets.cpp +++ b/src/managers/input/Tablets.cpp @@ -226,4 +226,4 @@ void CInputManager::focusTablet(STablet* pTab, wlr_tablet_tool* pTool, bool moti if (PTOOL->pSurface) wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2); } -} \ No newline at end of file +} -- cgit v1.2.3 From 72c86b99eb87b23c11fdc795ec6f3668f283b95c Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 24 Jun 2022 23:27:02 +0200 Subject: added general:cursor_inactive_timeout --- src/managers/input/InputManager.cpp | 8 ++++++++ src/managers/input/InputManager.hpp | 3 +++ 2 files changed, 11 insertions(+) (limited to 'src/managers') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 46d6338e..d58a9986 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -14,12 +14,16 @@ void CInputManager::onMouseMoved(wlr_pointer_motion_event* e) { wlr_cursor_move(g_pCompositor->m_sWLRCursor, &e->pointer->base, DELTA.x * sensitivity, DELTA.y * sensitivity); mouseMoveUnified(e->time_msec); + + m_tmrLastCursorMovement.reset(); } void CInputManager::onMouseWarp(wlr_pointer_motion_absolute_event* e) { wlr_cursor_warp_absolute(g_pCompositor->m_sWLRCursor, &e->pointer->base, e->x, e->y); mouseMoveUnified(e->time_msec); + + m_tmrLastCursorMovement.reset(); } void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { @@ -205,6 +209,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { void CInputManager::onMouseButton(wlr_pointer_button_event* e) { wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat); + m_tmrLastCursorMovement.reset(); + const auto PKEYBOARD = wlr_seat_get_keyboard(g_pCompositor->m_sSeat.seat); if (!PKEYBOARD) { // ??? @@ -383,6 +389,8 @@ void CInputManager::newMouse(wlr_input_device* mouse) { g_pCompositor->m_sSeat.mouse = PMOUSE; + m_tmrLastCursorMovement.reset(); + Debug::log(LOG, "New mouse created, pointer WLR: %x", mouse); } diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp index ef962bdd..73c59b8f 100644 --- a/src/managers/input/InputManager.hpp +++ b/src/managers/input/InputManager.hpp @@ -4,6 +4,7 @@ #include #include "../../helpers/WLClasses.hpp" #include "../../Window.hpp" +#include "../../helpers/Timer.hpp" class CInputManager { public: @@ -52,6 +53,8 @@ public: SKeyboard* m_pActiveKeyboard = nullptr; + CTimer m_tmrLastCursorMovement; + private: uint32_t m_uiCapabilities = 0; -- cgit v1.2.3 From 3842b1641fb6c8197fbc79eb0e62a66b4f1cb4c1 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 25 Jun 2022 11:20:03 +0200 Subject: allow move to 0 0 --- src/managers/KeybindManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/managers') diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 85fb3919..931b7225 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -954,8 +954,8 @@ void CKeybindManager::moveActive(std::string args) { const int X = std::stoi(newX); const int Y = std::stoi(newY); - if (X < 10 || Y < 10) { - Debug::log(ERR, "moveActive: exact args cannot be < 10"); + if (X < 0 || Y < 0) { + Debug::log(ERR, "moveActive: exact args cannot be < 0"); return; } -- cgit v1.2.3 From b46f45befab6e2aa6daba76ec04cec4286eec56b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 25 Jun 2022 11:50:09 +0200 Subject: additional keymap reload safety --- src/managers/input/InputManager.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/managers') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index d58a9986..f99c6ab4 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -277,7 +277,7 @@ void CInputManager::newKeyboard(wlr_input_device* keyboard) { m_pActiveKeyboard->active = false; m_pActiveKeyboard = PNEWKEYBOARD; - setKeyboardLayout(); + applyConfigToKeyboard(PNEWKEYBOARD); wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, keyboard->keyboard); @@ -299,6 +299,11 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { const auto VARIANT = g_pConfigManager->getString("input:kb_variant"); const auto OPTIONS = g_pConfigManager->getString("input:kb_options"); + if (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; + } + xkb_rule_names rules = { .rules = RULES.c_str(), .model = MODEL.c_str(), @@ -306,6 +311,8 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { .variant = VARIANT.c_str(), .options = OPTIONS.c_str()}; + pKeyboard->currentRules = rules; + const auto CONTEXT = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (!CONTEXT) { @@ -313,12 +320,17 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { return; } - const auto KEYMAP = xkb_keymap_new_from_names(CONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); + Debug::log(LOG, "Attempting to create a keymap for layout %s with variant %s (rules: %s, model: %s, options: %s)", rules.layout, rules.variant, rules.rules, rules.model, rules.options); + + auto KEYMAP = xkb_keymap_new_from_names(CONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); if (!KEYMAP) { 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); - xkb_context_unref(CONTEXT); - return; + memset(&rules, 0, sizeof(rules)); + + pKeyboard->currentRules = rules; + + KEYMAP = xkb_keymap_new_from_names(CONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); } wlr_keyboard_set_keymap(pKeyboard->keyboard->keyboard, KEYMAP); -- cgit v1.2.3 From 45898a57c846527f942ee346682911056eec7336 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 25 Jun 2022 21:18:33 +0200 Subject: guard windows' validity in focuswindowbyclass --- src/managers/KeybindManager.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/managers') diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 931b7225..5ddd45a9 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -999,6 +999,9 @@ void CKeybindManager::focusWindowByClass(std::string clazz) { std::regex classCheck(clazz); for (auto& w : g_pCompositor->m_lWindows) { + if (!w.m_bIsMapped || w.m_bHidden) + continue; + const auto windowClass = g_pXWaylandManager->getAppIDClass(&w); if (!std::regex_search(windowClass, classCheck)) -- cgit v1.2.3 From 78bf88ba607d0efff0e270bc16562e2081a34037 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 26 Jun 2022 12:12:29 +0200 Subject: Added fullscreen rule --- src/managers/KeybindManager.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/managers') diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 5ddd45a9..10694e1b 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -366,14 +366,7 @@ void CKeybindManager::fullscreenActive(std::string args) { if (!g_pCompositor->windowValidMapped(PWINDOW)) return; - g_pLayoutManager->getCurrentLayout()->fullscreenRequestForWindow(PWINDOW, args == "1" ? eFullscreenMode::FULLSCREEN_MAXIMIZED : eFullscreenMode::FULLSCREEN_FULL); - - g_pXWaylandManager->setWindowFullscreen(PWINDOW, PWINDOW->m_bIsFullscreen && (args == "0" || args == "")); - // make all windows on the same workspace under the fullscreen window - for (auto& w : g_pCompositor->m_lWindows) { - if (w.m_iWorkspaceID == PWINDOW->m_iWorkspaceID) - w.m_bCreatedOverFullscreen = false; - } + g_pCompositor->setWindowFullscreen(PWINDOW, !PWINDOW->m_bIsFullscreen, args == "1" ? FULLSCREEN_MAXIMIZED : FULLSCREEN_FULL); } void CKeybindManager::moveActiveToWorkspace(std::string args) { -- cgit v1.2.3