diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index e6ae4f4c..6f803d23 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -394,6 +394,7 @@ scrcpy(const struct scrcpy_options *options) { .window_borderless = options->window_borderless, .rotation = options->rotation, .mipmaps = options->mipmaps, + .fullscreen = options->fullscreen, }; if (!screen_init(&screen, &video_buffer, &fps_counter, @@ -411,10 +412,6 @@ scrcpy(const struct scrcpy_options *options) { LOGW("Could not request 'set screen power mode'"); } } - - if (options->fullscreen) { - screen_switch_fullscreen(&screen); - } } // now we consumed the header values, the socket receives the video stream diff --git a/app/src/screen.c b/app/src/screen.c index 3ded4263..ed810264 100644 --- a/app/src/screen.c +++ b/app/src/screen.c @@ -362,6 +362,10 @@ screen_init(struct screen *screen, struct video_buffer *vb, screen_update_content_rect(screen); + if (params->fullscreen) { + screen_switch_fullscreen(screen); + } + return true; } diff --git a/app/src/screen.h b/app/src/screen.h index e725bad6..dca65d41 100644 --- a/app/src/screen.h +++ b/app/src/screen.h @@ -52,6 +52,8 @@ struct screen_params { uint8_t rotation; bool mipmaps; + + bool fullscreen; }; // initialize screen, create window, renderer and texture (window is hidden)