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:
Maximilian Seidler
2024-03-15 17:17:13 +01:00
committed by GitHub
parent bb933dcf04
commit a958884b52
4 changed files with 40 additions and 11 deletions

View File

@@ -1,10 +1,13 @@
#pragma once
#include "../defines.hpp"
#include "../helpers/Timer.hpp"
#include <cstdint>
#include <unordered_map>
struct SSessionLockSurface {
wlr_session_lock_surface_v1* pWlrLockSurface = nullptr;
int iMonitorID = -1;
uint64_t iMonitorID = -1;
bool mapped = false;
@@ -18,6 +21,7 @@ struct SSessionLock {
wlr_session_lock_v1* pWlrLock = nullptr;
std::vector<std::unique_ptr<SSessionLockSurface>> vSessionLockSurfaces;
std::unordered_map<uint64_t, CTimer> mMonitorsWithoutMappedSurfaceTimers;
DYNLISTENER(newSurface);
DYNLISTENER(unlock);
@@ -30,7 +34,9 @@ class CSessionLockManager {
~CSessionLockManager() = default;
void onNewSessionLock(wlr_session_lock_v1*);
SSessionLockSurface* getSessionLockSurfaceForMonitor(const int&);
SSessionLockSurface* getSessionLockSurfaceForMonitor(uint64_t);
float getRedScreenAlphaForMonitor(uint64_t);
bool isSessionLocked();
bool isSurfaceSessionLock(wlr_surface*);