summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-04-14 03:43:47 +0200
committerGitHub <noreply@github.com>2022-04-14 03:43:47 +0200
commit46da380b571b46d85bf0a6e62ce7a74c9fdce832 (patch)
treeaa5bc5404eb263aec32597f4c8b50c02b6ba76f6 /src
parentMerge pull request #8202 from merryhime/fix-single-core (diff)
parentemu_window_sdl2: Set window size to display dimensions for exclusive fullscreen (diff)
downloadyuzu-46da380b571b46d85bf0a6e62ce7a74c9fdce832.tar
yuzu-46da380b571b46d85bf0a6e62ce7a74c9fdce832.tar.gz
yuzu-46da380b571b46d85bf0a6e62ce7a74c9fdce832.tar.bz2
yuzu-46da380b571b46d85bf0a6e62ce7a74c9fdce832.tar.lz
yuzu-46da380b571b46d85bf0a6e62ce7a74c9fdce832.tar.xz
yuzu-46da380b571b46d85bf0a6e62ce7a74c9fdce832.tar.zst
yuzu-46da380b571b46d85bf0a6e62ce7a74c9fdce832.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
index 57f807826..ae2e62dc5 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
@@ -123,14 +123,15 @@ void EmuWindow_SDL2::ShowCursor(bool show_cursor) {
}
void EmuWindow_SDL2::Fullscreen() {
+ SDL_DisplayMode display_mode;
switch (Settings::values.fullscreen_mode.GetValue()) {
case Settings::FullscreenMode::Exclusive:
- // Set window size to render size before entering fullscreen -- SDL does not resize to
- // display dimensions in this mode.
- // TODO: Multiply the window size by resolution_factor (for both docked modes)
- if (Settings::values.use_docked_mode) {
- SDL_SetWindowSize(render_window, Layout::ScreenDocked::Width,
- Layout::ScreenDocked::Height);
+ // Set window size to render size before entering fullscreen -- SDL2 does not resize window
+ // to display dimensions automatically in this mode.
+ if (SDL_GetDesktopDisplayMode(0, &display_mode) == 0) {
+ SDL_SetWindowSize(render_window, display_mode.w, display_mode.h);
+ } else {
+ LOG_ERROR(Frontend, "SDL_GetDesktopDisplayMode failed: {}", SDL_GetError());
}
if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN) == 0) {