Set initial fullscreen from screen.c

This commit is contained in:
Romain Vimont 2021-04-13 22:10:45 +02:00
parent c6d7f5ee96
commit 65c4f487b3
3 changed files with 7 additions and 4 deletions

View file

@ -394,6 +394,7 @@ scrcpy(const struct scrcpy_options *options) {
.window_borderless = options->window_borderless, .window_borderless = options->window_borderless,
.rotation = options->rotation, .rotation = options->rotation,
.mipmaps = options->mipmaps, .mipmaps = options->mipmaps,
.fullscreen = options->fullscreen,
}; };
if (!screen_init(&screen, &video_buffer, &fps_counter, 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'"); 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 // now we consumed the header values, the socket receives the video stream

View file

@ -362,6 +362,10 @@ screen_init(struct screen *screen, struct video_buffer *vb,
screen_update_content_rect(screen); screen_update_content_rect(screen);
if (params->fullscreen) {
screen_switch_fullscreen(screen);
}
return true; return true;
} }

View file

@ -52,6 +52,8 @@ struct screen_params {
uint8_t rotation; uint8_t rotation;
bool mipmaps; bool mipmaps;
bool fullscreen;
}; };
// initialize screen, create window, renderer and texture (window is hidden) // initialize screen, create window, renderer and texture (window is hidden)