mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 14:42:01 -07:00
layerrules: add abovelock to render above lockscreen (#9793)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user