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:
parent
7aa0942ec1
commit
98cca4f3b7
5 changed files with 33 additions and 7 deletions
|
|
@ -168,9 +168,13 @@ pub fn init_backend(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// start x11
|
if state.common.with_xwayland {
|
||||||
let primary = *state.backend.kms().primary_node.read().unwrap();
|
// start x11
|
||||||
state.launch_xwayland(primary);
|
let primary = *state.backend.kms().primary_node.read().unwrap();
|
||||||
|
state.launch_xwayland(primary);
|
||||||
|
} else {
|
||||||
|
state.notify_ready();
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,12 @@ pub fn init_backend(
|
||||||
}
|
}
|
||||||
state.common.refresh();
|
state.common.refresh();
|
||||||
}
|
}
|
||||||
state.launch_xwayland(None);
|
|
||||||
|
if state.common.with_xwayland {
|
||||||
|
state.launch_xwayland(None);
|
||||||
|
} else {
|
||||||
|
state.notify_ready();
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -384,7 +384,12 @@ pub fn init_backend(
|
||||||
}
|
}
|
||||||
state.common.refresh();
|
state.common.refresh();
|
||||||
}
|
}
|
||||||
state.launch_xwayland(None);
|
|
||||||
|
if state.common.with_xwayland {
|
||||||
|
state.launch_xwayland(None);
|
||||||
|
} else {
|
||||||
|
state.notify_ready();
|
||||||
|
}
|
||||||
|
|
||||||
event_loop
|
event_loop
|
||||||
.handle()
|
.handle()
|
||||||
|
|
|
||||||
11
src/lib.rs
11
src/lib.rs
|
|
@ -109,6 +109,7 @@ pub fn run(hooks: crate::hooks::Hooks) -> Result<(), Box<dyn Error>> {
|
||||||
let mut cursor = raw_args.cursor();
|
let mut cursor = raw_args.cursor();
|
||||||
let git_hash = option_env!("GIT_HASH").unwrap_or("unknown");
|
let git_hash = option_env!("GIT_HASH").unwrap_or("unknown");
|
||||||
|
|
||||||
|
let mut with_xwayland = true;
|
||||||
// Parse the arguments
|
// Parse the arguments
|
||||||
while let Some(arg) = raw_args.next_os(&mut cursor) {
|
while let Some(arg) = raw_args.next_os(&mut cursor) {
|
||||||
match arg.to_str() {
|
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);
|
print_help(env!("CARGO_PKG_VERSION"), git_hash);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
Some("--no-xwayland") => {
|
||||||
|
tracing::info!("Running without Xwayland");
|
||||||
|
with_xwayland = false;
|
||||||
|
}
|
||||||
Some("--version") | Some("-V") => {
|
Some("--version") | Some("-V") => {
|
||||||
println!(
|
println!(
|
||||||
"cosmic-comp {} (git commit {})",
|
"cosmic-comp {} (git commit {})",
|
||||||
|
|
@ -152,6 +157,7 @@ pub fn run(hooks: crate::hooks::Hooks) -> Result<(), Box<dyn Error>> {
|
||||||
socket,
|
socket,
|
||||||
event_loop.handle(),
|
event_loop.handle(),
|
||||||
event_loop.get_signal(),
|
event_loop.get_signal(),
|
||||||
|
with_xwayland,
|
||||||
);
|
);
|
||||||
// init backend
|
// init backend
|
||||||
backend::init_backend_auto(&display, &mut event_loop, &mut state)?;
|
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
|
Project home page: https://github.com/pop-os/cosmic-comp
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h, --help Show this message
|
-h, --help Show this message
|
||||||
-v, --version Show the version of cosmic-comp"#
|
--no-xwayland Run without Xwayland
|
||||||
|
-v, --version Show the version of cosmic-comp"#
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -296,6 +296,8 @@ pub struct Common {
|
||||||
|
|
||||||
#[cfg(feature = "systemd")]
|
#[cfg(feature = "systemd")]
|
||||||
pub inhibit_lid_fd: Option<OwnedFd>,
|
pub inhibit_lid_fd: Option<OwnedFd>,
|
||||||
|
|
||||||
|
pub with_xwayland: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
@ -626,6 +628,7 @@ impl State {
|
||||||
socket: OsString,
|
socket: OsString,
|
||||||
handle: LoopHandle<'static, State>,
|
handle: LoopHandle<'static, State>,
|
||||||
signal: LoopSignal,
|
signal: LoopSignal,
|
||||||
|
with_xwayland: bool,
|
||||||
) -> State {
|
) -> State {
|
||||||
let requested_languages = DesktopLanguageRequester::requested_languages();
|
let requested_languages = DesktopLanguageRequester::requested_languages();
|
||||||
i18n_embed::select(&*LANG_LOADER, &Localizations, &requested_languages)
|
i18n_embed::select(&*LANG_LOADER, &Localizations, &requested_languages)
|
||||||
|
|
@ -801,6 +804,8 @@ impl State {
|
||||||
|
|
||||||
#[cfg(feature = "systemd")]
|
#[cfg(feature = "systemd")]
|
||||||
inhibit_lid_fd: None,
|
inhibit_lid_fd: None,
|
||||||
|
|
||||||
|
with_xwayland,
|
||||||
},
|
},
|
||||||
backend: BackendData::Unset,
|
backend: BackendData::Unset,
|
||||||
ready: Once::new(),
|
ready: Once::new(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue