mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-02 05:12:02 +00:00
[client] wayland: allow seatless operation for github CI testing
This commit is contained in:
@@ -342,6 +342,12 @@ bool waylandCBInit(void)
|
|||||||
{
|
{
|
||||||
memset(&wlCb, 0, sizeof(wlCb));
|
memset(&wlCb, 0, sizeof(wlCb));
|
||||||
|
|
||||||
|
if (!wlWm.seat)
|
||||||
|
{
|
||||||
|
DEBUG_WARN("Clipboard unavailable without wl_seat");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!wlWm.dataDeviceManager)
|
if (!wlWm.dataDeviceManager)
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("Missing wl_data_device_manager interface (version 3+)");
|
DEBUG_ERROR("Missing wl_data_device_manager interface (version 3+)");
|
||||||
|
|||||||
@@ -405,10 +405,17 @@ static const struct wl_seat_listener seatListener = {
|
|||||||
.name = seatNameHandler,
|
.name = seatNameHandler,
|
||||||
};
|
};
|
||||||
|
|
||||||
bool waylandInputInit(void)
|
bool waylandInputInit(bool allowNoInput)
|
||||||
{
|
{
|
||||||
if (!wlWm.seat)
|
if (!wlWm.seat)
|
||||||
{
|
{
|
||||||
|
if (allowNoInput)
|
||||||
|
{
|
||||||
|
DEBUG_WARN("Compositor missing wl_seat, input will be disabled");
|
||||||
|
wlWm.warpSupport = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG_ERROR("Compositor missing wl_seat, will not proceed");
|
DEBUG_ERROR("Compositor missing wl_seat, will not proceed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -444,6 +451,9 @@ bool waylandInputInit(void)
|
|||||||
|
|
||||||
void waylandInputFree(void)
|
void waylandInputFree(void)
|
||||||
{
|
{
|
||||||
|
if (!wlWm.seat)
|
||||||
|
return;
|
||||||
|
|
||||||
waylandUngrabPointer();
|
waylandUngrabPointer();
|
||||||
|
|
||||||
if (wlWm.pointer)
|
if (wlWm.pointer)
|
||||||
@@ -468,7 +478,8 @@ void waylandInputFree(void)
|
|||||||
|
|
||||||
void waylandGrabPointer(void)
|
void waylandGrabPointer(void)
|
||||||
{
|
{
|
||||||
if (!wlWm.relativePointerManager || !wlWm.pointerConstraints)
|
if (!wlWm.pointer ||
|
||||||
|
!wlWm.relativePointerManager || !wlWm.pointerConstraints)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!wlWm.warpSupport && !wlWm.relativePointer)
|
if (!wlWm.warpSupport && !wlWm.relativePointer)
|
||||||
@@ -493,6 +504,9 @@ void waylandGrabPointer(void)
|
|||||||
|
|
||||||
inline static void internalUngrabPointer(bool lock)
|
inline static void internalUngrabPointer(bool lock)
|
||||||
{
|
{
|
||||||
|
if (!wlWm.pointer)
|
||||||
|
return;
|
||||||
|
|
||||||
if (lock)
|
if (lock)
|
||||||
LG_LOCK(wlWm.surfaceLock);
|
LG_LOCK(wlWm.surfaceLock);
|
||||||
|
|
||||||
@@ -578,7 +592,8 @@ void waylandUncapturePointer(void)
|
|||||||
|
|
||||||
void waylandGrabKeyboard(void)
|
void waylandGrabKeyboard(void)
|
||||||
{
|
{
|
||||||
if (wlWm.keyboardInhibitManager && !wlWm.keyboardInhibitor)
|
if (wlWm.seat &&
|
||||||
|
wlWm.keyboardInhibitManager && !wlWm.keyboardInhibitor)
|
||||||
{
|
{
|
||||||
wlWm.keyboardInhibitor = zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts(
|
wlWm.keyboardInhibitor = zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts(
|
||||||
wlWm.keyboardInhibitManager, wlWm.surface, wlWm.seat);
|
wlWm.keyboardInhibitManager, wlWm.surface, wlWm.seat);
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ static bool waylandInit(const LG_DSInitParams params)
|
|||||||
if (!waylandCursorInit())
|
if (!waylandCursorInit())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!waylandInputInit())
|
if (!waylandInputInit(params.allowNoInput))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
wlWm.desktop->setSize(params.w, params.h);
|
wlWm.desktop->setSize(params.w, params.h);
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ void waylandInhibitIdle(void);
|
|||||||
void waylandUninhibitIdle(void);
|
void waylandUninhibitIdle(void);
|
||||||
|
|
||||||
// input module
|
// input module
|
||||||
bool waylandInputInit(void);
|
bool waylandInputInit(bool allowNoInput);
|
||||||
void waylandInputFree(void);
|
void waylandInputFree(void);
|
||||||
void waylandGrabKeyboard(void);
|
void waylandGrabKeyboard(void);
|
||||||
void waylandGrabPointer(void);
|
void waylandGrabPointer(void);
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ typedef struct LG_DSInitParams
|
|||||||
bool borderless;
|
bool borderless;
|
||||||
bool maximize;
|
bool maximize;
|
||||||
bool largeCursorDot;
|
bool largeCursorDot;
|
||||||
|
bool allowNoInput;
|
||||||
|
|
||||||
// if true the renderer requires an OpenGL context
|
// if true the renderer requires an OpenGL context
|
||||||
bool opengl;
|
bool opengl;
|
||||||
|
|||||||
@@ -1288,6 +1288,7 @@ static int lg_run(void)
|
|||||||
.borderless = g_params.borderless,
|
.borderless = g_params.borderless,
|
||||||
.maximize = g_params.maximize,
|
.maximize = g_params.maximize,
|
||||||
.largeCursorDot = g_params.largeCursorDot,
|
.largeCursorDot = g_params.largeCursorDot,
|
||||||
|
.allowNoInput = strcmp(g_params.transport, "test") == 0,
|
||||||
.opengl = needsOpenGL,
|
.opengl = needsOpenGL,
|
||||||
.jitRender = g_params.jitRender
|
.jitRender = g_params.jitRender
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user