Skip to content

Commit 4556cfd

Browse files
committed
feat: add xr-only flag to completely disable the flatscreen window
Signed-off-by: Schmarni <[email protected]>
1 parent 40de9d3 commit 4556cfd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ struct CliArgs {
103103
#[clap(short, long, action)]
104104
force_flatscreen: bool,
105105

106+
/// Force disable the flatscreen window
107+
#[clap(short, long, action)]
108+
xr_only: bool,
109+
106110
/// Replaces the flatscreen mode with a first person spectator camera
107111
#[clap(short, long, action)]
108112
spectator: bool,
@@ -346,8 +350,9 @@ fn bevy_loop(
346350
.async_compute
347351
.on_thread_spawn = Some(enter_runtime_context.clone());
348352
plugins = plugins.set(task_pool_plugin);
349-
if std::env::var("DISPLAY").is_ok_and(|s| !s.is_empty())
350-
|| std::env::var("WAYLAND_DISPLAY").is_ok_and(|s| !s.is_empty())
353+
if (std::env::var("DISPLAY").is_ok_and(|s| !s.is_empty())
354+
|| std::env::var("WAYLAND_DISPLAY").is_ok_and(|s| !s.is_empty()))
355+
&& !args.xr_only
351356
{
352357
let mut plugin = WinitPlugin::<WakeUp>::default();
353358
plugin.run_on_any_thread = true;

0 commit comments

Comments
 (0)