summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 8ca8c21d..2153b916 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -306,6 +306,17 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse) {
g_pLayoutManager->getCurrentLayout()->onMouseMove(getMouseCoordsInternal());
+ // forced above all
+ if (!g_pInputManager->m_dExclusiveLSes.empty()) {
+ if (!foundSurface)
+ foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &g_pInputManager->m_dExclusiveLSes, &surfaceCoords, &pFoundLayerSurface);
+
+ if (!foundSurface) {
+ foundSurface = (*g_pInputManager->m_dExclusiveLSes.begin())->surface->resource();
+ surfacePos = (*g_pInputManager->m_dExclusiveLSes.begin())->realPosition->goal();
+ }
+ }
+
if (!foundSurface)
foundSurface = g_pCompositor->vectorToLayerPopupSurface(mouseCoords, PMONITOR, &surfaceCoords, &pFoundLayerSurface);
@@ -1420,10 +1431,15 @@ void CInputManager::refocus() {
mouseMoveUnified(0, true);
}
-void CInputManager::refocusLastWindow(PHLMONITOR pMonitor) {
+bool CInputManager::refocusLastWindow(PHLMONITOR pMonitor) {
+ if (!m_dExclusiveLSes.empty()) {
+ Debug::log(LOG, "CInputManager::refocusLastWindow: ignoring, exclusive LS present.");
+ return false;
+ }
+
if (!pMonitor) {
refocus();
- return;
+ return true;
}
Vector2D surfaceCoords;
@@ -1432,10 +1448,6 @@ void CInputManager::refocusLastWindow(PHLMONITOR pMonitor) {
g_pInputManager->releaseAllMouseButtons();
- // first try for an exclusive layer
- if (!m_dExclusiveLSes.empty())
- foundSurface = m_dExclusiveLSes[m_dExclusiveLSes.size() - 1]->surface->resource();
-
// then any surfaces above windows on the same monitor
if (!foundSurface) {
foundSurface = g_pCompositor->vectorToLayerSurface(g_pInputManager->getMouseCoordsInternal(), &pMonitor->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY],
@@ -1465,6 +1477,8 @@ void CInputManager::refocusLastWindow(PHLMONITOR pMonitor) {
refocus();
}
+
+ return true;
}
void CInputManager::unconstrainMouse() {