[client] input: abstract guest input backends

Introduce LG_InputOps and route keyboard and mouse input through the
active video transport when it provides an input backend.

Keep SPICE as the fallback and force it while the SPICE display is
active. Add atomic shared/exclusive locking for safe backend changes.
This commit is contained in:
Geoffrey McRae
2026-08-08 21:23:32 +10:00
parent 04fd31219c
commit f495e5b7ba
17 changed files with 711 additions and 105 deletions

View File

@@ -27,6 +27,7 @@
#include "common/framebuffer.h"
#include "common/types.h"
#include "interface/input.h"
#define LG_TRANSPORT_MAX_DAMAGE_RECTS LG_MAX_FRAME_DAMAGE_RECTS
@@ -244,6 +245,10 @@ typedef struct LG_TransportOps
void (*disconnect)(LG_Transport * transport);
bool (*sessionValid)(LG_Transport * transport);
bool (*supportsDMA)(LG_Transport * transport);
/* Queried after connect. The returned operations and opaque value remain
* valid until disconnect; NULL indicates that this session has no input. */
const LG_InputOps *(*getInputOps)(LG_Transport * transport,
void ** opaque);
bool (*attachRenderer)(LG_Transport * transport,
const LG_RendererInterop * interop);
void (*detachRenderer)(LG_Transport * transport);