diff options
| author | 2022-04-13 18:43:47 -0700 | |
|---|---|---|
| committer | 2022-04-13 18:43:47 -0700 | |
| commit | 46da380b571b46d85bf0a6e62ce7a74c9fdce832 (patch) | |
| tree | aa5bc5404eb263aec32597f4c8b50c02b6ba76f6 /src | |
| parent | Merge pull request #8202 from merryhime/fix-single-core (diff) | |
| parent | emu_window_sdl2: Set window size to display dimensions for exclusive fullscreen (diff) | |
| download | yuzu-46da380b571b46d85bf0a6e62ce7a74c9fdce832.tar.gz yuzu-46da380b571b46d85bf0a6e62ce7a74c9fdce832.tar.xz yuzu-46da380b571b46d85bf0a6e62ce7a74c9fdce832.zip | |
Merge pull request #8027 from lat9nq/cmd-fullscreen-size
emu_window_sdl2: Set window size to display dimensions for exclusive fullscreen
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 13 |
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) { | |||
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | void EmuWindow_SDL2::Fullscreen() { | 125 | void EmuWindow_SDL2::Fullscreen() { |
| 126 | SDL_DisplayMode display_mode; | ||
| 126 | switch (Settings::values.fullscreen_mode.GetValue()) { | 127 | switch (Settings::values.fullscreen_mode.GetValue()) { |
| 127 | case Settings::FullscreenMode::Exclusive: | 128 | case Settings::FullscreenMode::Exclusive: |
| 128 | // Set window size to render size before entering fullscreen -- SDL does not resize to | 129 | // Set window size to render size before entering fullscreen -- SDL2 does not resize window |
| 129 | // display dimensions in this mode. | 130 | // to display dimensions automatically in this mode. |
| 130 | // TODO: Multiply the window size by resolution_factor (for both docked modes) | 131 | if (SDL_GetDesktopDisplayMode(0, &display_mode) == 0) { |
| 131 | if (Settings::values.use_docked_mode) { | 132 | SDL_SetWindowSize(render_window, display_mode.w, display_mode.h); |
| 132 | SDL_SetWindowSize(render_window, Layout::ScreenDocked::Width, | 133 | } else { |
| 133 | Layout::ScreenDocked::Height); | 134 | LOG_ERROR(Frontend, "SDL_GetDesktopDisplayMode failed: {}", SDL_GetError()); |
| 134 | } | 135 | } |
| 135 | 136 | ||
| 136 | if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN) == 0) { | 137 | if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN) == 0) { |