Skip to content

Commit

Permalink
Allow controls with --no-window
Browse files Browse the repository at this point in the history
Without a window, mouse and keyboard events may not be received, but
the control channel is still necessary for other features:

 * --turn-screen-off
 * --stay-awake
 * --show-touches
 * --power-off-on-close
 * --start-app

Fixes #5803 <#5803>
PR #5804 <#5804>

Signed-off-by: Romain Vimont <[email protected]>
  • Loading branch information
samlii authored and rom1v committed Jan 31, 2025
1 parent c27d116 commit 986328f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/scrcpy.1
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Disable video playback on the computer.

.TP
.B \-\-no\-window
Disable scrcpy window. Implies --no-video-playback and --no-control.
Disable scrcpy window. Implies --no-video-playback.

.TP
.BI "\-\-orientation " value
Expand Down
8 changes: 4 additions & 4 deletions app/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,7 @@ static const struct sc_option options[] = {
{
.longopt_id = OPT_NO_WINDOW,
.longopt = "no-window",
.text = "Disable scrcpy window. Implies --no-video-playback and "
"--no-control.",
.text = "Disable scrcpy window. Implies --no-video-playback.",
},
{
.longopt_id = OPT_ORIENTATION,
Expand Down Expand Up @@ -2761,9 +2760,10 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
#endif

if (!opts->window) {
// Without window, there cannot be any video playback or control
// Without window, there cannot be any video playback
opts->video_playback = false;
opts->control = false;
// Controls are still possible, allowing for options like
// --turn-screen-off
}

if (!opts->video) {
Expand Down

0 comments on commit 986328f

Please sign in to comment.