Skip to content

Commit f5aeecb

Browse files
committed
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 <#15>
1 parent e40532a commit f5aeecb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/src/screen.c

+5
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ screen_init_rendering(struct screen *screen, const char *window_title,
325325
return false;
326326
}
327327

328+
// Reset the window size to trigger a SIZE_CHANGED event, to workaround
329+
// HiDPI issues with some SDL renderers when several displays having
330+
// different HiDPI scaling are connected
331+
SDL_SetWindowSize(screen->window, window_size.width, window_size.height);
332+
328333
screen_update_content_rect(screen);
329334

330335
return true;

0 commit comments

Comments
 (0)