Add option to enable cursor overlay rendering

pull/14/head
Dan Shick 2020-02-11 17:01:19 -05:00
parent c274c81fa3
commit e53b4dfc9d
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"
" -k,--keyboard=<layout> Select keyboard layout.\n"
" -s,--seat=<name> Select seat by name.\n"
" -r,--render-cursor Enable overlay cursor rendering.\n"
" -h,--help Get help (this text).\n"
"\n";
@ -631,8 +632,10 @@ int main(int argc, char* argv[])
const char* output_name = NULL;
enum frame_capture_backend_type fcbackend = FRAME_CAPTURE_BACKEND_NONE;
const char* seat_name = NULL;
bool overlay_cursor = false;
static const char* shortopts = "C:c:o:k:s:h";
static const char* shortopts = "C:c:o:k:s:rh";
static const struct option longopts[] = {
{ "config", required_argument, NULL, 'C' },
@ -640,6 +643,7 @@ int main(int argc, char* argv[])
{ "output", required_argument, NULL, 'o' },
{ "keyboard", required_argument, NULL, 'k' },
{ "seat", required_argument, NULL, 's' },
{ "render-cursor", no_argument, NULL, 'r' },
{ "help", no_argument, NULL, 'h' },
{ NULL, 0, NULL, 0 }
};
@ -671,6 +675,9 @@ int main(int argc, char* argv[])
case 's':
seat_name = optarg;
break;
case 'r':
overlay_cursor = true;
break;
case 'h':
return wayvnc_usage(stdout, 0);
default:
@ -810,6 +817,8 @@ int main(int argc, char* argv[])
break;
}
self.capture_backend->overlay_cursor = overlay_cursor;
if (wayvnc_start_capture(&self) < 0)
goto capture_failure;