From 03eb969886879182d757afc9ae02a1a7b3d0add7 Mon Sep 17 00:00:00 2001 From: p-sam Date: Tue, 10 Oct 2023 19:18:05 +0000 Subject: [PATCH] switch: address PR comments --- src/config.c | 1 - src/video.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index 49ac3a0da1..1462df394d 100644 --- a/src/config.c +++ b/src/config.c @@ -499,7 +499,6 @@ void config_load(void) { #ifdef __SWITCH__ config_set_int(CONFIG_GAMEPAD_ENABLED, true); config_set_str(CONFIG_GAMEPAD_DEVICE, "any"); - config_set_int(CONFIG_FULLSCREEN, 0); config_set_int(CONFIG_VID_WIDTH, nxGetInitialScreenWidth()); config_set_int(CONFIG_VID_HEIGHT, nxGetInitialScreenHeight()); #endif diff --git a/src/video.c b/src/video.c index 29c09a0829..711b07551b 100644 --- a/src/video.c +++ b/src/video.c @@ -142,6 +142,8 @@ static VideoCapabilityState video_query_capability_alwaysfullscreen(VideoCapabil static VideoCapabilityState video_query_capability_switch(VideoCapability cap) { switch(cap) { + // We want the window to be resizable and resized internally by SDL + // when the Switch gets docked/undocked case VIDEO_CAP_FULLSCREEN: return VIDEO_NEVER_AVAILABLE; @@ -777,6 +779,7 @@ static bool video_handle_window_event(SDL_Event *event, void *arg) { log_debug("SDL_WINDOWEVENT_SIZE_CHANGED: %ix%i", event->window.data1, event->window.data2); // Catch resizes by the SDL portlib itself, when the console is docked/undocked + // https://github.com/devkitPro/SDL/issues/31 if(video_get_backend() == VIDEO_BACKEND_SWITCH) { video_handle_resize(event->window.data1, event->window.data2); }