mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 14:10:03 +01:00
touch: fix LS on different monitor than cursor not getting touch events
This commit is contained in:
parent
09e195d1f2
commit
6a821f7b78
3 changed files with 10 additions and 10 deletions
|
|
@ -183,7 +183,7 @@ void CInputManager::sendMotionEventsToFocused() {
|
||||||
g_pSeatManager->setPointerFocus(Desktop::focusState()->surface(), LOCAL);
|
g_pSeatManager->setPointerFocus(Desktop::focusState()->surface(), LOCAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, std::optional<Vector2D> overridePos) {
|
void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, std::optional<Vector2D> overridePos, std::optional<PHLMONITOR> monitor) {
|
||||||
m_lastInputMouse = mouse;
|
m_lastInputMouse = mouse;
|
||||||
|
|
||||||
if (!g_pCompositor->m_readyToProcess || g_pCompositor->m_isShuttingDown || g_pCompositor->m_unsafeState)
|
if (!g_pCompositor->m_readyToProcess || g_pCompositor->m_isShuttingDown || g_pCompositor->m_unsafeState)
|
||||||
|
|
@ -224,7 +224,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st
|
||||||
|
|
||||||
m_lastCursorPosFloored = MOUSECOORDSFLOORED;
|
m_lastCursorPosFloored = MOUSECOORDSFLOORED;
|
||||||
|
|
||||||
const auto PMONITOR = isLocked() && Desktop::focusState()->monitor() ? Desktop::focusState()->monitor() : g_pCompositor->getMonitorFromCursor();
|
const auto PMONITOR = monitor ? monitor.value() : isLocked() && Desktop::focusState()->monitor() ? Desktop::focusState()->monitor() : g_pCompositor->getMonitorFromCursor();
|
||||||
|
|
||||||
// this can happen if there are no displays hooked up to Hyprland
|
// this can happen if there are no displays hooked up to Hyprland
|
||||||
if (PMONITOR == nullptr)
|
if (PMONITOR == nullptr)
|
||||||
|
|
@ -1547,8 +1547,8 @@ bool CInputManager::shouldIgnoreVirtualKeyboard(SP<IKeyboard> pKeyboard) {
|
||||||
return DISALLOWACTION;
|
return DISALLOWACTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInputManager::refocus(std::optional<Vector2D> overridePos) {
|
void CInputManager::refocus(std::optional<Vector2D> overridePos, std::optional<PHLMONITOR> monitor) {
|
||||||
mouseMoveUnified(0, true, false, overridePos);
|
mouseMoveUnified(0, true, false, overridePos, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CInputManager::refocusLastWindow(PHLMONITOR pMonitor) {
|
bool CInputManager::refocusLastWindow(PHLMONITOR pMonitor) {
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ class CInputManager {
|
||||||
bool isLocked();
|
bool isLocked();
|
||||||
|
|
||||||
Vector2D getMouseCoordsInternal();
|
Vector2D getMouseCoordsInternal();
|
||||||
void refocus(std::optional<Vector2D> overridePos = std::nullopt);
|
void refocus(std::optional<Vector2D> overridePos = std::nullopt, std::optional<PHLMONITOR> monitor = std::nullopt);
|
||||||
bool refocusLastWindow(PHLMONITOR pMonitor);
|
bool refocusLastWindow(PHLMONITOR pMonitor);
|
||||||
void simulateMouseMovement();
|
void simulateMouseMovement();
|
||||||
void sendMotionEventsToFocused();
|
void sendMotionEventsToFocused();
|
||||||
|
|
@ -244,7 +244,7 @@ class CInputManager {
|
||||||
|
|
||||||
uint32_t m_capabilities = 0;
|
uint32_t m_capabilities = 0;
|
||||||
|
|
||||||
void mouseMoveUnified(uint32_t, bool refocus = false, bool mouse = false, std::optional<Vector2D> overridePos = std::nullopt);
|
void mouseMoveUnified(uint32_t, bool refocus = false, bool mouse = false, std::optional<Vector2D> overridePos = std::nullopt, std::optional<PHLMONITOR> monitor = std::nullopt);
|
||||||
void recheckMouseWarpOnMouseInput();
|
void recheckMouseWarpOnMouseInput();
|
||||||
|
|
||||||
SP<CTabletTool> ensureTabletToolPresent(SP<Aquamarine::ITabletTool>);
|
SP<CTabletTool> ensureTabletToolPresent(SP<Aquamarine::ITabletTool>);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ void CInputManager::onTouchDown(ITouch::SDownEvent e) {
|
||||||
|
|
||||||
const auto TOUCH_COORDS = PMONITOR->m_position + (e.pos * PMONITOR->m_size);
|
const auto TOUCH_COORDS = PMONITOR->m_position + (e.pos * PMONITOR->m_size);
|
||||||
|
|
||||||
refocus(TOUCH_COORDS);
|
refocus(TOUCH_COORDS, PMONITOR);
|
||||||
|
|
||||||
if (m_clickBehavior == CLICKMODE_KILL) {
|
if (m_clickBehavior == CLICKMODE_KILL) {
|
||||||
IPointer::SButtonEvent e;
|
IPointer::SButtonEvent e;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue