From 58cc8551f8a9bd46000f4bb0f37ec6be7238417a Mon Sep 17 00:00:00 2001 From: hexnet1234 Date: Mon, 9 Mar 2026 19:18:33 +0100 Subject: [PATCH] Add option to disable mouse input --- cage.c | 6 +++++- seat.c | 2 +- server.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cage.c b/cage.c index 7c3d89d..7a398c5 100644 --- a/cage.c +++ b/cage.c @@ -241,6 +241,7 @@ usage(FILE *file, const char *cage) fprintf(file, "Usage: %s [OPTIONS] [--] [APPLICATION...]\n" "\n" + " -c\t Disable mouse input, and hide the cursor\n" " -d\t Don't draw client side decorations, when possible\n" " -D\t Enable debug logging\n" " -h\t Display this help message\n" @@ -257,8 +258,11 @@ static bool parse_args(struct cg_server *server, int argc, char *argv[]) { int c; - while ((c = getopt(argc, argv, "dDhm:sv")) != -1) { + while ((c = getopt(argc, argv, "cdDhm:sv")) != -1) { switch (c) { + case 'c': + server->disable_mouse = true; + break; case 'd': server->xdg_decoration = true; break; diff --git a/seat.c b/seat.c index 5f659a4..667fa18 100644 --- a/seat.c +++ b/seat.c @@ -118,7 +118,7 @@ update_capabilities(struct cg_seat *seat) if (!wl_list_empty(&seat->keyboard_groups)) { caps |= WL_SEAT_CAPABILITY_KEYBOARD; } - if (!wl_list_empty(&seat->pointers)) { + if (!wl_list_empty(&seat->pointers) && !seat->server->disable_mouse) { caps |= WL_SEAT_CAPABILITY_POINTER; } if (!wl_list_empty(&seat->touch)) { diff --git a/server.h b/server.h index 27f212a..c62b82a 100644 --- a/server.h +++ b/server.h @@ -70,6 +70,7 @@ struct cg_server { struct wlr_foreign_toplevel_manager_v1 *foreign_toplevel_manager; + bool disable_mouse; bool xdg_decoration; bool allow_vt_switch; bool return_app_code;