feat: add --no-xwayland argument for running without Xwayland

This leaves the default behavior in place. When --no-xwayland
is not passed, Xwayland is started. If it is passed, then
starting Xwayland is skipped.
This commit is contained in:
RoyalOughtness 2026-01-24 16:30:47 -08:00 committed by Jacob Kauffmann
parent 7aa0942ec1
commit 98cca4f3b7
5 changed files with 33 additions and 7 deletions

View file

@ -109,6 +109,7 @@ pub fn run(hooks: crate::hooks::Hooks) -> Result<(), Box<dyn Error>> {
let mut cursor = raw_args.cursor();
let git_hash = option_env!("GIT_HASH").unwrap_or("unknown");
let mut with_xwayland = true;
// Parse the arguments
while let Some(arg) = raw_args.next_os(&mut cursor) {
match arg.to_str() {
@ -116,6 +117,10 @@ pub fn run(hooks: crate::hooks::Hooks) -> Result<(), Box<dyn Error>> {
print_help(env!("CARGO_PKG_VERSION"), git_hash);
return Ok(());
}
Some("--no-xwayland") => {
tracing::info!("Running without Xwayland");
with_xwayland = false;
}
Some("--version") | Some("-V") => {
println!(
"cosmic-comp {} (git commit {})",
@ -152,6 +157,7 @@ pub fn run(hooks: crate::hooks::Hooks) -> Result<(), Box<dyn Error>> {
socket,
event_loop.handle(),
event_loop.get_signal(),
with_xwayland,
);
// init backend
backend::init_backend_auto(&display, &mut event_loop, &mut state)?;
@ -239,8 +245,9 @@ Designed for the COSMIC™ desktop environment, cosmic-comp is a Wayland Composi
Project home page: https://github.com/pop-os/cosmic-comp
Options:
-h, --help Show this message
-v, --version Show the version of cosmic-comp"#
-h, --help Show this message
--no-xwayland Run without Xwayland
-v, --version Show the version of cosmic-comp"#
);
}