mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 06:31:57 -07:00
lock: fix red screen issues with multiple monitors (#5100)
* lock: use uint64_t for iMonitorID * lock: move activateLock to onNewSessionLock * lock: add red screen fade * lock: damage when fading the red screen and delay for screencopy * lock: remove redundant scheduleFrameForMonitor
This commit is contained in:
committed by
GitHub
parent
bb933dcf04
commit
a958884b52
@@ -815,16 +815,23 @@ void CHyprRenderer::renderAllClientsForWorkspace(CMonitor* pMonitor, CWorkspace*
|
||||
g_pHyprOpenGL->m_RenderData.renderModif = {};
|
||||
}
|
||||
|
||||
void CHyprRenderer::renderLockscreen(CMonitor* pMonitor, timespec* now) {
|
||||
void CHyprRenderer::renderLockscreen(CMonitor* pMonitor, timespec* now, const CBox& geometry) {
|
||||
TRACY_GPU_ZONE("RenderLockscreen");
|
||||
|
||||
if (g_pSessionLockManager->isSessionLocked()) {
|
||||
const auto PSLS = g_pSessionLockManager->getSessionLockSurfaceForMonitor(pMonitor->ID);
|
||||
Vector2D translate = {geometry.x, geometry.y};
|
||||
float scale = (float)geometry.width / pMonitor->vecPixelSize.x;
|
||||
|
||||
const auto PSLS = g_pSessionLockManager->getSessionLockSurfaceForMonitor(pMonitor->ID);
|
||||
if (!PSLS) {
|
||||
// locked with no surface, fill with red
|
||||
CBox boxe = {0, 0, INT16_MAX, INT16_MAX};
|
||||
g_pHyprOpenGL->renderRect(&boxe, CColor(1.0, 0.2, 0.2, 1.0));
|
||||
const auto ALPHA = g_pSessionLockManager->getRedScreenAlphaForMonitor(pMonitor->ID);
|
||||
|
||||
CBox monbox = {translate.x, translate.y, pMonitor->vecTransformedSize.x * scale, pMonitor->vecTransformedSize.y * scale};
|
||||
g_pHyprOpenGL->renderRect(&monbox, CColor(1.0, 0.2, 0.2, ALPHA));
|
||||
|
||||
if (ALPHA < 1.f) /* animate */
|
||||
damageMonitor(pMonitor);
|
||||
} else {
|
||||
renderSessionLockSurface(PSLS, pMonitor, now);
|
||||
}
|
||||
@@ -1206,7 +1213,7 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||
CBox renderBox = {0, 0, (int)pMonitor->vecPixelSize.x, (int)pMonitor->vecPixelSize.y};
|
||||
renderWorkspace(pMonitor, g_pCompositor->getWorkspaceByID(pMonitor->activeWorkspace), &now, renderBox);
|
||||
|
||||
renderLockscreen(pMonitor, &now);
|
||||
renderLockscreen(pMonitor, &now, renderBox);
|
||||
|
||||
if (pMonitor == g_pCompositor->m_pLastMonitor) {
|
||||
g_pHyprNotificationOverlay->draw(pMonitor);
|
||||
|
Reference in New Issue
Block a user