diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-08-25 12:17:44 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-08-25 12:17:48 +0200 |
| commit | ad085666c100ee7cb35f769508a65b9457082019 (patch) | |
| tree | 0733ff3032932bdac0247d8c13a76fe538afd183 /src/managers/input/InputManager.cpp | |
| parent | 90c03e5bd2204ba6d1a0167c68f65b7a9231bef4 (diff) | |
input: sanitize newlines in device names
fixes #3066 by replacing newlines with dashes in device names
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index bda2e5ee..7bc84b82 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -1463,6 +1463,7 @@ void CInputManager::unsetCursorImage() { std::string CInputManager::deviceNameToInternalString(std::string in) { std::replace(in.begin(), in.end(), ' ', '-'); + std::replace(in.begin(), in.end(), '\n', '-'); std::transform(in.begin(), in.end(), in.begin(), ::tolower); return in; } @@ -1538,7 +1539,7 @@ void CInputManager::setCursorIconOnBorder(CWindow* w) { wlr_box box = {w->m_vRealPosition.vec().x, w->m_vRealPosition.vec().y, w->m_vRealSize.vec().x, w->m_vRealSize.vec().y}; eBorderIconDirection direction = BORDERICON_NONE; wlr_box boxFullGrabInput = {box.x - *PEXTENDBORDERGRAB - BORDERSIZE, box.y - *PEXTENDBORDERGRAB - BORDERSIZE, box.width + 2 * (*PEXTENDBORDERGRAB + BORDERSIZE), - box.height + 2 * (*PEXTENDBORDERGRAB + BORDERSIZE)}; + box.height + 2 * (*PEXTENDBORDERGRAB + BORDERSIZE)}; if (!wlr_box_contains_point(&boxFullGrabInput, mouseCoords.x, mouseCoords.y) || (!m_lCurrentlyHeldButtons.empty() && !currentlyDraggedWindow)) { direction = BORDERICON_NONE; |
