aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-27 13:48:52 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-27 13:48:52 -0400
commit399d053e4fac2d65d3d2b20f5b358b168b0c09ee (patch)
treee02f2196f21ca8dabd87ceacad80d7574be1a556 /src
parent63f61e109f2d303b62f8b908dbacadc13b79408f (diff)
eden-cli: EDEN_NX2_HIDE_WINDOW for unattended test runs
Creates the render window hidden and not focusable so test runs don't cover or interrupt the desktop.
Diffstat (limited to 'src')
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl3.h8
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl3_gl.cpp2
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl3_null.cpp2
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl3_vk.cpp2
4 files changed, 11 insertions, 3 deletions
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl3.h b/src/yuzu_cmd/emu_window/emu_window_sdl3.h
index ffabaeb143..bcac169849 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl3.h
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl3.h
@@ -6,6 +6,7 @@
#pragma once
+#include <cstdlib>
#include <tuple>
#include <utility>
@@ -24,6 +25,13 @@ class InputSubsystem;
enum class MouseButton;
} // namespace InputCommon
+// EDEN_NX2_HIDE_WINDOW=1 creates the render window hidden and without focus, for unattended
+// test runs that must not cover or interrupt the desktop.
+inline SDL_WindowFlags Nx2HiddenWindowFlags() {
+ return std::getenv("EDEN_NX2_HIDE_WINDOW") != nullptr ? SDL_WINDOW_HIDDEN | SDL_WINDOW_NOT_FOCUSABLE
+ : SDL_WindowFlags{0};
+}
+
class EmuWindow_SDL3 : public Core::Frontend::EmuWindow {
public:
explicit EmuWindow_SDL3(InputCommon::InputSubsystem* input_subsystem_, Core::System& system_);
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl3_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl3_gl.cpp
index e86858a232..38cc340426 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl3_gl.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl3_gl.cpp
@@ -101,7 +101,7 @@ EmuWindow_SDL3_GL::EmuWindow_SDL3_GL(InputCommon::InputSubsystem* input_subsyste
SDL_CreateWindow(window_title.c_str(), Layout::ScreenUndocked::Width,
Layout::ScreenUndocked::Height,
SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE |
- SDL_WINDOW_HIGH_PIXEL_DENSITY);
+ SDL_WINDOW_HIGH_PIXEL_DENSITY | Nx2HiddenWindowFlags());
if (render_window == nullptr) {
LOG_CRITICAL(Frontend, "Failed to create SDL3 window! {}", SDL_GetError());
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl3_null.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl3_null.cpp
index f5e4e19a30..45ff657f13 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl3_null.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl3_null.cpp
@@ -31,7 +31,7 @@ EmuWindow_SDL3_Null::EmuWindow_SDL3_Null(InputCommon::InputSubsystem* input_subs
render_window =
SDL_CreateWindow(window_title.c_str(), Layout::ScreenUndocked::Width,
Layout::ScreenUndocked::Height,
- SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY);
+ SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY | Nx2HiddenWindowFlags());
SetWindowIcon();
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl3_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl3_vk.cpp
index 9019cbbba0..afbe67716f 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl3_vk.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl3_vk.cpp
@@ -29,7 +29,7 @@ EmuWindow_SDL3_VK::EmuWindow_SDL3_VK(InputCommon::InputSubsystem* input_subsyste
render_window =
SDL_CreateWindow(window_title.c_str(), Layout::ScreenUndocked::Width,
Layout::ScreenUndocked::Height,
- SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY);
+ SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY | Nx2HiddenWindowFlags());
const SDL_PropertiesID window_props = SDL_GetWindowProperties(render_window);