summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMikhail Burakov <mburakov@mailbox.org>2023-10-17 10:33:24 +0200
committerMikhail Burakov <mburakov@mailbox.org>2023-10-17 10:33:24 +0200
commit9aa119e6765568103f5a41b401b305dff509e13a (patch)
treefdedde63346f64238c328cd814d8dfd6b372cc2f /main.c
parente9f288fd0912cde18cddd78eae030e0e877c228c (diff)
Allow disabling uhid interop from the commandline
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/main.c b/main.c
index e848536..0242bce 100644
--- a/main.c
+++ b/main.c
@@ -44,6 +44,7 @@ static volatile sig_atomic_t g_signal;
static void OnSignal(int status) { g_signal = status; }
struct Contexts {
+ bool disable_uhid;
struct GpuContext* gpu_context;
struct IoMuxer io_muxer;
int server_fd;
@@ -231,7 +232,7 @@ static void OnClientConnecting(void* user) {
LOG("Failed to schedule client reading (%s)", strerror(errno));
goto drop_client;
}
- contexts->input_handler = InputHandlerCreate();
+ contexts->input_handler = InputHandlerCreate(contexts->disable_uhid);
if (!contexts->input_handler) {
LOG("Failed to create input handler");
goto drop_client;
@@ -265,7 +266,7 @@ drop_client:
int main(int argc, char* argv[]) {
if (argc < 2) {
- LOG("Usage: %s <port>", argv[0]);
+ LOG("Usage: %s <port> [--disable-uhid]", argv[0]);
return EXIT_FAILURE;
}
if (signal(SIGINT, OnSignal) == SIG_ERR ||
@@ -279,6 +280,11 @@ int main(int argc, char* argv[]) {
.server_fd = -1,
.client_fd = -1,
};
+ for (int i = 2; i < argc; i++) {
+ if (!strcmp(argv[i], "--disable-uhid")) {
+ contexts.disable_uhid = true;
+ }
+ }
contexts.gpu_context = GpuContextCreate(colorspace, range);
if (!contexts.gpu_context) {
LOG("Failed to create gpu context");