mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-04-06 07:15:42 -04:00
Command line option to hide cursor.
This commit is contained in:
parent
e7d8780f46
commit
9387fa4c20
3 changed files with 8 additions and 3 deletions
6
cage.c
6
cage.c
|
|
@ -208,6 +208,7 @@ usage(FILE *file, const char *cage)
|
||||||
fprintf(file,
|
fprintf(file,
|
||||||
"Usage: %s [OPTIONS] [--] APPLICATION\n"
|
"Usage: %s [OPTIONS] [--] APPLICATION\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
" -c\t Hide cursor\n"
|
||||||
" -d\t Don't draw client side decorations, when possible\n"
|
" -d\t Don't draw client side decorations, when possible\n"
|
||||||
" -h\t Display this help message\n"
|
" -h\t Display this help message\n"
|
||||||
" -m extend Extend the display across all connected outputs (default)\n"
|
" -m extend Extend the display across all connected outputs (default)\n"
|
||||||
|
|
@ -223,8 +224,11 @@ static bool
|
||||||
parse_args(struct cg_server *server, int argc, char *argv[])
|
parse_args(struct cg_server *server, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
while ((c = getopt(argc, argv, "dhm:sv")) != -1) {
|
while ((c = getopt(argc, argv, "cdhm:sv")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
case 'c':
|
||||||
|
server->hide_cursor = true;
|
||||||
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
server->xdg_decoration = true;
|
server->xdg_decoration = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
4
seat.c
4
seat.c
|
|
@ -127,7 +127,7 @@ update_capabilities(struct cg_seat *seat)
|
||||||
wlr_seat_set_capabilities(seat->seat, caps);
|
wlr_seat_set_capabilities(seat->seat, caps);
|
||||||
|
|
||||||
/* Hide cursor if the seat doesn't have pointer capability. */
|
/* Hide cursor if the seat doesn't have pointer capability. */
|
||||||
if ((caps & WL_SEAT_CAPABILITY_POINTER) == 0) {
|
if ((caps & WL_SEAT_CAPABILITY_POINTER) == 0 || seat->server->hide_cursor == true) {
|
||||||
wlr_cursor_unset_image(seat->cursor);
|
wlr_cursor_unset_image(seat->cursor);
|
||||||
} else {
|
} else {
|
||||||
wlr_cursor_set_xcursor(seat->cursor, seat->xcursor_manager, DEFAULT_XCURSOR);
|
wlr_cursor_set_xcursor(seat->cursor, seat->xcursor_manager, DEFAULT_XCURSOR);
|
||||||
|
|
@ -482,7 +482,7 @@ handle_request_set_cursor(struct wl_listener *listener, void *data)
|
||||||
|
|
||||||
/* This can be sent by any client, so we check to make sure
|
/* This can be sent by any client, so we check to make sure
|
||||||
* this one actually has pointer focus first. */
|
* this one actually has pointer focus first. */
|
||||||
if (focused_client == event->seat_client->client) {
|
if (focused_client == event->seat_client->client && seat->server->hide_cursor == false) {
|
||||||
wlr_cursor_set_surface(seat->cursor, event->surface, event->hotspot_x, event->hotspot_y);
|
wlr_cursor_set_surface(seat->cursor, event->surface, event->hotspot_x, event->hotspot_y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
server.h
1
server.h
|
|
@ -60,6 +60,7 @@ struct cg_server {
|
||||||
bool xdg_decoration;
|
bool xdg_decoration;
|
||||||
bool allow_vt_switch;
|
bool allow_vt_switch;
|
||||||
bool return_app_code;
|
bool return_app_code;
|
||||||
|
bool hide_cursor;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue