Merge pull request #14 from danshick/cursor_overlay_flag

Added cli flag to change overlay_cursor option, defaulting to false
pull/15/head
Andri Yngvason 2020-02-11 23:49:35 +01:00 committed by GitHub
commit 4d6f477d71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -575,6 +575,7 @@ int wayvnc_usage(FILE* stream, int rc)
" -o,--output=<name> Select output to capture.\n" " -o,--output=<name> Select output to capture.\n"
" -k,--keyboard=<layout> Select keyboard layout.\n" " -k,--keyboard=<layout> Select keyboard layout.\n"
" -s,--seat=<name> Select seat by name.\n" " -s,--seat=<name> Select seat by name.\n"
" -r,--render-cursor Enable overlay cursor rendering.\n"
" -h,--help Get help (this text).\n" " -h,--help Get help (this text).\n"
"\n"; "\n";
@ -632,7 +633,9 @@ int main(int argc, char* argv[])
enum frame_capture_backend_type fcbackend = FRAME_CAPTURE_BACKEND_NONE; enum frame_capture_backend_type fcbackend = FRAME_CAPTURE_BACKEND_NONE;
const char* seat_name = NULL; const char* seat_name = NULL;
static const char* shortopts = "C:c:o:k:s:h"; bool overlay_cursor = false;
static const char* shortopts = "C:c:o:k:s:rh";
static const struct option longopts[] = { static const struct option longopts[] = {
{ "config", required_argument, NULL, 'C' }, { "config", required_argument, NULL, 'C' },
@ -640,6 +643,7 @@ int main(int argc, char* argv[])
{ "output", required_argument, NULL, 'o' }, { "output", required_argument, NULL, 'o' },
{ "keyboard", required_argument, NULL, 'k' }, { "keyboard", required_argument, NULL, 'k' },
{ "seat", required_argument, NULL, 's' }, { "seat", required_argument, NULL, 's' },
{ "render-cursor", no_argument, NULL, 'r' },
{ "help", no_argument, NULL, 'h' }, { "help", no_argument, NULL, 'h' },
{ NULL, 0, NULL, 0 } { NULL, 0, NULL, 0 }
}; };
@ -671,6 +675,9 @@ int main(int argc, char* argv[])
case 's': case 's':
seat_name = optarg; seat_name = optarg;
break; break;
case 'r':
overlay_cursor = true;
break;
case 'h': case 'h':
return wayvnc_usage(stdout, 0); return wayvnc_usage(stdout, 0);
default: default:
@ -814,6 +821,8 @@ int main(int argc, char* argv[])
break; break;
} }
self.capture_backend->overlay_cursor = overlay_cursor;
if (wayvnc_start_capture(&self) < 0) if (wayvnc_start_capture(&self) < 0)
goto capture_failure; goto capture_failure;