diff --git a/src/pc/gfx/gfx_sdl1.c b/src/pc/gfx/gfx_sdl1.c index cd045e55..7659a58d 100644 --- a/src/pc/gfx/gfx_sdl1.c +++ b/src/pc/gfx/gfx_sdl1.c @@ -95,6 +95,10 @@ static void gfx_sdl_set_mode(void) { } static void gfx_sdl_init(const char *window_title) { +#if defined(_WIN32) || defined(_WIN64) + SetProcessDPIAware(); +#endif + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) sys_fatal("Could not init SDL1 video: %s\n", SDL_GetError()); @@ -114,10 +118,6 @@ static void gfx_sdl_init(const char *window_title) { } controller_bind_init(); - -#if defined(_WIN32) || defined(_WIN64) - SetProcessDPIAware(); -#endif } static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) { diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c index e0b678a8..dab9e0e3 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c @@ -112,6 +112,10 @@ static void gfx_sdl_reset_dimension_and_pos(void) { } static void gfx_sdl_init(const char *window_title) { +#if defined(_WIN32) || defined(_WIN64) + SetProcessDPIAware(); +#endif + SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0"); SDL_Init(SDL_INIT_VIDEO); SDL_StartTextInput(); @@ -143,10 +147,6 @@ static void gfx_sdl_init(const char *window_title) { } controller_bind_init(); - -#if defined(_WIN32) || defined(_WIN64) - SetProcessDPIAware(); -#endif } static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) {