diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 12 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h | 2 | ||||
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 2 |
4 files changed, 13 insertions, 9 deletions
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 896181f0b..8dfc09393 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | |||
| @@ -122,12 +122,6 @@ void EmuWindow_SDL2::OnResize() { | |||
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | void EmuWindow_SDL2::Fullscreen() { | 124 | void EmuWindow_SDL2::Fullscreen() { |
| 125 | if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN) == 0) { | ||
| 126 | return; | ||
| 127 | } | ||
| 128 | |||
| 129 | LOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError()); | ||
| 130 | |||
| 131 | // Try a different fullscreening method | 125 | // Try a different fullscreening method |
| 132 | LOG_INFO(Frontend, "Attempting to use borderless fullscreen..."); | 126 | LOG_INFO(Frontend, "Attempting to use borderless fullscreen..."); |
| 133 | if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN_DESKTOP) == 0) { | 127 | if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN_DESKTOP) == 0) { |
| @@ -136,6 +130,12 @@ void EmuWindow_SDL2::Fullscreen() { | |||
| 136 | 130 | ||
| 137 | LOG_ERROR(Frontend, "Borderless fullscreening failed: {}", SDL_GetError()); | 131 | LOG_ERROR(Frontend, "Borderless fullscreening failed: {}", SDL_GetError()); |
| 138 | 132 | ||
| 133 | if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN) == 0) { | ||
| 134 | return; | ||
| 135 | } | ||
| 136 | |||
| 137 | LOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError()); | ||
| 138 | |||
| 139 | // Fallback algorithm: Maximise window. | 139 | // Fallback algorithm: Maximise window. |
| 140 | // Works on all systems (unless something is seriously wrong), so no fallback for this one. | 140 | // Works on all systems (unless something is seriously wrong), so no fallback for this one. |
| 141 | LOG_INFO(Frontend, "Falling back on a maximised window..."); | 141 | LOG_INFO(Frontend, "Falling back on a maximised window..."); |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp index 152e56db8..d1473dbab 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | #include <SDL.h> | 24 | #include <SDL.h> |
| 25 | #include <SDL_syswm.h> | 25 | #include <SDL_syswm.h> |
| 26 | 26 | ||
| 27 | EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem) | 27 | EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem, bool fullscreen) |
| 28 | : EmuWindow_SDL2{input_subsystem} { | 28 | : EmuWindow_SDL2{input_subsystem} { |
| 29 | const std::string window_title = fmt::format("yuzu {} | {}-{} (Vulkan)", Common::g_build_name, | 29 | const std::string window_title = fmt::format("yuzu {} | {}-{} (Vulkan)", Common::g_build_name, |
| 30 | Common::g_scm_branch, Common::g_scm_desc); | 30 | Common::g_scm_branch, Common::g_scm_desc); |
| @@ -42,6 +42,10 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste | |||
| 42 | 42 | ||
| 43 | SetWindowIcon(); | 43 | SetWindowIcon(); |
| 44 | 44 | ||
| 45 | if (fullscreen) { | ||
| 46 | Fullscreen(); | ||
| 47 | } | ||
| 48 | |||
| 45 | switch (wm.subsystem) { | 49 | switch (wm.subsystem) { |
| 46 | #ifdef SDL_VIDEO_DRIVER_WINDOWS | 50 | #ifdef SDL_VIDEO_DRIVER_WINDOWS |
| 47 | case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS: | 51 | case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS: |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h index bdfdc3c6f..de53844f0 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h | |||
| @@ -19,7 +19,7 @@ class InputSubsystem; | |||
| 19 | 19 | ||
| 20 | class EmuWindow_SDL2_VK final : public EmuWindow_SDL2 { | 20 | class EmuWindow_SDL2_VK final : public EmuWindow_SDL2 { |
| 21 | public: | 21 | public: |
| 22 | explicit EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem); | 22 | explicit EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem, bool fullscreen); |
| 23 | ~EmuWindow_SDL2_VK() override; | 23 | ~EmuWindow_SDL2_VK() override; |
| 24 | 24 | ||
| 25 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override; | 25 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override; |
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 9607cdcb1..ac4ea88d3 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -175,7 +175,7 @@ int main(int argc, char** argv) { | |||
| 175 | emu_window = std::make_unique<EmuWindow_SDL2_GL>(&input_subsystem, fullscreen); | 175 | emu_window = std::make_unique<EmuWindow_SDL2_GL>(&input_subsystem, fullscreen); |
| 176 | break; | 176 | break; |
| 177 | case Settings::RendererBackend::Vulkan: | 177 | case Settings::RendererBackend::Vulkan: |
| 178 | emu_window = std::make_unique<EmuWindow_SDL2_VK>(&input_subsystem); | 178 | emu_window = std::make_unique<EmuWindow_SDL2_VK>(&input_subsystem, fullscreen); |
| 179 | break; | 179 | break; |
| 180 | } | 180 | } |
| 181 | 181 | ||