mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 15:11:57 -07:00
input: sanitize newlines in device names
fixes #3066 by replacing newlines with dashes in device names
This commit is contained in:
@@ -1463,6 +1463,7 @@ void CInputManager::unsetCursorImage() {
|
|||||||
|
|
||||||
std::string CInputManager::deviceNameToInternalString(std::string in) {
|
std::string CInputManager::deviceNameToInternalString(std::string in) {
|
||||||
std::replace(in.begin(), in.end(), ' ', '-');
|
std::replace(in.begin(), in.end(), ' ', '-');
|
||||||
|
std::replace(in.begin(), in.end(), '\n', '-');
|
||||||
std::transform(in.begin(), in.end(), in.begin(), ::tolower);
|
std::transform(in.begin(), in.end(), in.begin(), ::tolower);
|
||||||
return in;
|
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};
|
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;
|
eBorderIconDirection direction = BORDERICON_NONE;
|
||||||
wlr_box boxFullGrabInput = {box.x - *PEXTENDBORDERGRAB - BORDERSIZE, box.y - *PEXTENDBORDERGRAB - BORDERSIZE, box.width + 2 * (*PEXTENDBORDERGRAB + BORDERSIZE),
|
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)) {
|
if (!wlr_box_contains_point(&boxFullGrabInput, mouseCoords.x, mouseCoords.y) || (!m_lCurrentlyHeldButtons.empty() && !currentlyDraggedWindow)) {
|
||||||
direction = BORDERICON_NONE;
|
direction = BORDERICON_NONE;
|
||||||
|
Reference in New Issue
Block a user