From 399d053e4fac2d65d3d2b20f5b358b168b0c09ee Mon Sep 17 00:00:00 2001 From: Takoroka <137927095+Takoroka@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:48:52 -0400 Subject: 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. --- src/yuzu_cmd/emu_window/emu_window_sdl3.h | 8 ++++++++ src/yuzu_cmd/emu_window/emu_window_sdl3_gl.cpp | 2 +- src/yuzu_cmd/emu_window/emu_window_sdl3_null.cpp | 2 +- src/yuzu_cmd/emu_window/emu_window_sdl3_vk.cpp | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') 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 #include #include @@ -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); -- cgit v1.2.3