layerrules: add abovelock to render above lockscreen (#9793)

This commit is contained in:
Virt
2025-04-25 16:38:31 +02:00
committed by GitHub
parent 41f5f67f6c
commit 4cf62c114e
9 changed files with 71 additions and 24 deletions

View File

@@ -2,6 +2,7 @@
#include "../../Compositor.hpp"
#include <aquamarine/output/Output.hpp>
#include <cstdint>
#include <hyprutils/math/Vector2D.hpp>
#include <ranges>
#include "../../config/ConfigValue.hpp"
#include "../../config/ConfigManager.hpp"
@@ -249,15 +250,29 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse) {
g_pCompositor->setActiveMonitor(PMONITOR);
if (g_pSessionLockManager->isSessionLocked()) {
// set keyboard focus on session lock surface regardless of layers
const auto PSESSIONLOCKSURFACE = g_pSessionLockManager->getSessionLockSurfaceForMonitor(PMONITOR->ID);
surfacePos = PMONITOR->vecPosition;
const auto foundLockSurface = PSESSIONLOCKSURFACE ? PSESSIONLOCKSURFACE->surface->surface() : nullptr;
foundSurface = PSESSIONLOCKSURFACE ? PSESSIONLOCKSURFACE->surface->surface() : nullptr;
g_pCompositor->focusSurface(foundSurface);
g_pCompositor->focusSurface(foundLockSurface);
// search for interactable abovelock surfaces for pointer focus, or use session lock surface if not found
for (auto& lsl : PMONITOR->m_aLayerSurfaceLayers | std::views::reverse) {
foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &lsl, &surfaceCoords, &pFoundLayerSurface, true);
if (foundSurface)
break;
}
if (!foundSurface) {
surfaceCoords = mouseCoords - PMONITOR->vecPosition;
foundSurface = foundLockSurface;
}
g_pSeatManager->setPointerFocus(foundSurface, surfaceCoords);
g_pSeatManager->sendPointerMotion(time, surfaceCoords);
const auto SURFACELOCAL = mouseCoords - surfacePos;
g_pSeatManager->setPointerFocus(foundSurface, SURFACELOCAL);
g_pSeatManager->sendPointerMotion(time, SURFACELOCAL);
return;
}