[idd] transport: coordinate recovery requests
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled

This commit is contained in:
Geoffrey McRae
2026-08-13 01:01:00 +10:00
parent fbc4640623
commit 5b9d4923a7
12 changed files with 752 additions and 171 deletions

View File

@@ -50,6 +50,29 @@ enum class InteractionResult
FAILED,
};
enum class RecoveryState
{
NORMAL,
ACTIVE,
FAILED,
};
struct RecoveryAdmission
{
bool complete = false;
RecoveryState state = RecoveryState::FAILED;
uint32_t error = 0;
};
struct RecoveryAction
{
uint64_t route = 0;
uint64_t session = 0;
uint64_t deadline = 0;
uint32_t serial = 0;
bool active = false;
};
class ITransportEvents
{
public:
@@ -59,10 +82,25 @@ public:
const SourceKey& source, int32_t x, int32_t y) = 0;
virtual InteractionResult OnSetResolution(
const SourceKey& source, uint32_t width, uint32_t height) = 0;
virtual void OnRecoveryRequest(const SourceKey& source,
virtual RecoveryAdmission OnRecoveryRequest(const SourceKey& source,
uint64_t session, uint32_t serial, bool active) = 0;
};
// Actions are implemented above the transport manager. Transport instances
// receive ITransportEvents only, so recovery work cannot bypass the manager's
// coordinator.
class ITransportActions
{
public:
virtual ~ITransportActions() = default;
virtual InteractionResult OnSetCursorPos(
const SourceKey& source, int32_t x, int32_t y) = 0;
virtual InteractionResult OnSetResolution(
const SourceKey& source, uint32_t width, uint32_t height) = 0;
virtual bool OnRecoveryAction(const RecoveryAction& action) = 0;
};
class ITransport
{
public:
@@ -80,12 +118,7 @@ public:
FAILURE,
};
enum class Recovery
{
NORMAL,
ACTIVE,
FAILED,
};
using Recovery = RecoveryState;
virtual ~ITransport() = default;
@@ -97,8 +130,8 @@ public:
virtual ProcessResult Process(ITransportEvents& events) = 0;
virtual void Stop() = 0;
virtual void SyncRecovery() {}
virtual void RecoveryStatus(
uint64_t, uint32_t, bool, Recovery, uint32_t) {}
virtual void RecoveryStatus(const SourceKey&, uint64_t, uint32_t,
bool, Recovery, uint32_t) {}
// Frame capabilities describe the configured instance, not transient
// runtime state. CanUseMode answers are immutable for the returned