main: Prevent capture restart if idle

This prevents restarting the capture on dimension change when idle.
Previously the capture was running after the dimensions had changed
which caused starting the capture once a client connects to fail.

Fixes #152
pull/162/head
Consolatis 2022-08-23 18:21:28 +02:00 committed by Andri Yngvason
parent f3247ad933
commit 34e95378e1
1 changed files with 3 additions and 0 deletions

View File

@ -614,6 +614,9 @@ void on_output_dimension_change(struct output* output)
struct wayvnc* self = output->userdata;
assert(self->selected_output == output);
if (self->nr_clients == 0)
return;
nvnc_log(NVNC_LOG_DEBUG, "Output dimensions changed. Restarting frame capturer...");
screencopy_stop(&self->screencopy);