summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorJunxuan Liao <70618504+MikeWalrus@users.noreply.github.com>2023-11-25 22:27:57 +0800
committerGitHub <noreply@github.com>2023-11-25 14:27:57 +0000
commit929c44e361fe5cc535a9226b05fba21a0e317d69 (patch)
tree92d55697604d7b80715f7c1c5f3898c58147f960 /src/managers/input/InputManager.cpp
parent512a59731b2e579b66325d0e9ce770919eecd685 (diff)
input: pass mouse input to IME popups (#3922)
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 2dba7515..058429c9 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -233,10 +233,20 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
surfacePos = PMONITOR->vecPosition;
}
- // overlay is above fullscreen
+ // overlays are above fullscreen
if (!foundSurface)
foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], &surfaceCoords, &pFoundLayerSurface);
+ // also IME popups
+ if (!foundSurface) {
+ auto popup = g_pCompositor->vectorToIMEPopup(mouseCoords, m_sIMERelay.m_lIMEPopups);
+ if (popup) {
+ foundSurface = popup->pSurface->surface;
+ surfacePos = Vector2D(popup->realX, popup->realY);
+ }
+ }
+
+ // also top layers
if (!foundSurface)
foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &surfaceCoords, &pFoundLayerSurface);
@@ -471,7 +481,6 @@ void CInputManager::onMouseButton(wlr_pointer_button_event* e) {
}
void CInputManager::processMouseRequest(wlr_seat_pointer_request_set_cursor_event* e) {
-
if (!e->surface)
g_pHyprRenderer->m_bWindowRequestedCursorHide = true;
else
@@ -1636,7 +1645,7 @@ void CInputManager::setCursorIconOnBorder(CWindow* w) {
CBox box = w->getWindowMainSurfaceBox();
eBorderIconDirection direction = BORDERICON_NONE;
CBox 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 (w->hasPopupAt(mouseCoords))
direction = BORDERICON_NONE;