mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 15:11:31 +00:00
[idd] recovery: unplug monitor without helper
When LGIddHelper is unavailable, recovery requests could remain pending until timeout while the virtual monitor stayed connected. This could leave a logged-out guest without a usable display. Fall back to departing the IDD monitor for active recovery, then re-arrive it before normal recovery completes. Serialize monitor lifecycle changes and preserve recovery ordering across Helper reconnects, timeouts, and stale responses.
This commit is contained in:
@@ -26,7 +26,9 @@
|
||||
#include <wdf.h>
|
||||
#include <IddCx.h>
|
||||
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -55,6 +57,19 @@ private:
|
||||
WDFTIMER m_transportTimer = nullptr;
|
||||
bool m_recoveryHandlerSet = false;
|
||||
|
||||
std::mutex m_recoveryTransitionMutex;
|
||||
CSRWLock m_localRecoveryLock;
|
||||
std::deque<RecoveryAction> m_localRecoveryQueue;
|
||||
RecoveryAction m_localRecoveryArrivalAction = {};
|
||||
RecoveryAction m_latestRecoveryAction = {};
|
||||
RecoveryAction m_helperRecoveryAction = {};
|
||||
bool m_localRecoveryArrival = false;
|
||||
bool m_latestRecoveryValid = false;
|
||||
bool m_helperRecoveryComplete = false;
|
||||
bool m_recoveryActive = false;
|
||||
bool m_recoveryMonitorDisabled = false;
|
||||
bool m_adapterReady = false;
|
||||
|
||||
UINT m_iddCxVersion = 0;
|
||||
bool m_hasIddCx110DDIs = false;
|
||||
bool m_canProcessFP16 = false;
|
||||
@@ -67,6 +82,12 @@ private:
|
||||
|
||||
bool InitializeTransport();
|
||||
void TransportTimer();
|
||||
static bool SameRecoveryAction(
|
||||
const RecoveryAction& left, const RecoveryAction& right);
|
||||
bool QueueLocalRecovery(const RecoveryAction& action);
|
||||
void RemoveLocalRecovery(const RecoveryAction& action);
|
||||
void ProcessLocalRecovery();
|
||||
void CompleteRecoveryArrival(bool arrived);
|
||||
InteractionResult OnSetCursorPos(
|
||||
const SourceKey& source, int32_t x, int32_t y) override;
|
||||
InteractionResult OnSetResolution(const SourceKey& source,
|
||||
|
||||
Reference in New Issue
Block a user