mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-14 01:58:25 +00:00
[client] add option to capture input on start
This commit is contained in:
parent
ede96fa486
commit
bd42445ea7
@ -309,6 +309,13 @@ static struct Option options[] =
|
|||||||
.type = OPTION_TYPE_BOOL,
|
.type = OPTION_TYPE_BOOL,
|
||||||
.value.x_bool = true
|
.value.x_bool = true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.module = "spice",
|
||||||
|
.name = "captureOnStart",
|
||||||
|
.description = "Capture mouse and keyboard on start",
|
||||||
|
.type = OPTION_TYPE_BOOL,
|
||||||
|
.value.x_bool = false
|
||||||
|
},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -413,6 +420,7 @@ bool config_load(int argc, char * argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
params.scaleMouseInput = option_get_bool("spice", "scaleCursor");
|
params.scaleMouseInput = option_get_bool("spice", "scaleCursor");
|
||||||
|
params.captureOnStart = option_get_bool("spice", "captureOnStart");
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -1394,6 +1394,14 @@ static int lg_run()
|
|||||||
SDL_ShowCursor(SDL_DISABLE);
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params.captureOnStart)
|
||||||
|
{
|
||||||
|
state.serverMode = true;
|
||||||
|
spice_mouse_mode(state.serverMode);
|
||||||
|
SDL_SetWindowGrab(state.window, state.serverMode);
|
||||||
|
DEBUG_INFO("Server Mode: %s", state.serverMode ? "on" : "off");
|
||||||
|
}
|
||||||
|
|
||||||
// setup the startup condition
|
// setup the startup condition
|
||||||
if (!(e_startup = lgCreateEvent(false, 0)))
|
if (!(e_startup = lgCreateEvent(false, 0)))
|
||||||
{
|
{
|
||||||
|
@ -124,6 +124,7 @@ struct AppParams
|
|||||||
bool grabKeyboard;
|
bool grabKeyboard;
|
||||||
SDL_Scancode escapeKey;
|
SDL_Scancode escapeKey;
|
||||||
bool showAlerts;
|
bool showAlerts;
|
||||||
|
bool captureOnStart;
|
||||||
|
|
||||||
unsigned int cursorPollInterval;
|
unsigned int cursorPollInterval;
|
||||||
unsigned int framePollInterval;
|
unsigned int framePollInterval;
|
||||||
|
Loading…
Reference in New Issue
Block a user