Reset window size on initialization
On macOS with renderer "metal", HiDPI scaling may be incorrect on initialization when several displays are connected. Resetting the window size fixes the problem. Refs #15 <https://github.com/Genymobile/scrcpy/issues/15>
This commit is contained in:
parent
a6dcbf34ba
commit
d0ecc6c460
@ -325,6 +325,11 @@ screen_init_rendering(struct screen *screen, const char *window_title,
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset the window size to trigger a SIZE_CHANGED event, to workaround
|
||||
// HiDPI issues with some SDL renderers when several displays having
|
||||
// different HiDPI scaling are connected
|
||||
SDL_SetWindowSize(screen->window, window_size.width, window_size.height);
|
||||
|
||||
screen_update_content_rect(screen);
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user