chore: update libcosmic
This commit is contained in:
parent
2d54688a73
commit
5ac8605e7e
5 changed files with 298 additions and 211 deletions
448
Cargo.lock
generated
448
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -59,19 +59,19 @@ libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = fa
|
|||
once_cell = "1"
|
||||
rust-embed = "8.5"
|
||||
rust-embed-utils = "8.5.0"
|
||||
rustix = { version = "0.38", features = ["fs", "process"] }
|
||||
rustix = { version = "1.0", features = ["fs", "process"] }
|
||||
zbus = { version = "5.7.1", default-features = false, features = ["tokio"] }
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
|
||||
tracing-log = "0.2.0"
|
||||
tokio = { version = "1.43.0", features = ["full"] }
|
||||
tokio = { version = "1.45.0", features = ["full"] }
|
||||
cosmic-config = { git = "https://github.com/pop-os/libcosmic" }
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
|
||||
[profile.release]
|
||||
opt-level = "s"
|
||||
panic = "abort"
|
||||
lto = "off"
|
||||
lto = "thin"
|
||||
|
||||
[workspace.metadata.cargo-machete]
|
||||
ignored = ["libcosmic"]
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ enum Message {
|
|||
ClosePopup,
|
||||
Activate(ExtForeignToplevelHandleV1),
|
||||
Toggle(ExtForeignToplevelHandleV1),
|
||||
Exec(String, Option<usize>),
|
||||
Exec(String, Option<usize>, bool),
|
||||
Quit(String),
|
||||
NewSeat(WlSeat),
|
||||
RemovedSeat,
|
||||
|
|
@ -1237,6 +1237,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
app_id,
|
||||
exec,
|
||||
gpu_idx,
|
||||
terminal,
|
||||
} => {
|
||||
let mut envs = Vec::new();
|
||||
if let Some(token) = token {
|
||||
|
|
@ -1252,7 +1253,13 @@ impl cosmic::Application for CosmicAppList {
|
|||
);
|
||||
}
|
||||
tokio::spawn(async move {
|
||||
cosmic::desktop::spawn_desktop_exec(exec, envs, app_id.as_deref()).await
|
||||
cosmic::desktop::spawn_desktop_exec(
|
||||
exec,
|
||||
envs,
|
||||
app_id.as_deref(),
|
||||
terminal,
|
||||
)
|
||||
.await
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1263,12 +1270,13 @@ impl cosmic::Application for CosmicAppList {
|
|||
Message::RemovedSeat => {
|
||||
self.seat.take();
|
||||
}
|
||||
Message::Exec(exec, gpu_idx) => {
|
||||
Message::Exec(exec, gpu_idx, terminal) => {
|
||||
if let Some(tx) = self.wayland_sender.as_ref() {
|
||||
let _ = tx.send(WaylandRequest::TokenRequest {
|
||||
app_id: Self::APP_ID.to_string(),
|
||||
exec,
|
||||
gpu_idx,
|
||||
terminal,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1824,10 +1832,10 @@ impl cosmic::Application for CosmicAppList {
|
|||
|
||||
if let Some(exec) = desktop_info.exec() {
|
||||
if !toplevels.is_empty() {
|
||||
content = content.push(
|
||||
menu_button(text::body(fl!("new-window")))
|
||||
.on_press(Message::Exec(exec.to_string(), None)),
|
||||
);
|
||||
content =
|
||||
content.push(menu_button(text::body(fl!("new-window"))).on_press(
|
||||
Message::Exec(exec.to_string(), None, desktop_info.terminal()),
|
||||
));
|
||||
} else if let Some(gpus) = self.gpus.as_ref() {
|
||||
let default_idx = if desktop_info.prefers_non_default_gpu() {
|
||||
gpus.iter().position(|gpu| !gpu.default).unwrap_or(0)
|
||||
|
|
@ -1845,14 +1853,17 @@ impl cosmic::Application for CosmicAppList {
|
|||
String::new()
|
||||
}
|
||||
)))
|
||||
.on_press(Message::Exec(exec.to_string(), Some(i))),
|
||||
.on_press(Message::Exec(
|
||||
exec.to_string(),
|
||||
Some(i),
|
||||
desktop_info.terminal(),
|
||||
)),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
content = content.push(
|
||||
menu_button(text::body(fl!("run")))
|
||||
.on_press(Message::Exec(exec.to_string(), None)),
|
||||
);
|
||||
content = content.push(menu_button(text::body(fl!("run"))).on_press(
|
||||
Message::Exec(exec.to_string(), None, desktop_info.terminal()),
|
||||
));
|
||||
}
|
||||
for action in desktop_info.actions().into_iter().flatten() {
|
||||
if action == "new-window" {
|
||||
|
|
@ -1867,10 +1878,9 @@ impl cosmic::Application for CosmicAppList {
|
|||
else {
|
||||
continue;
|
||||
};
|
||||
content = content.push(
|
||||
menu_button(text::body(name))
|
||||
.on_press(Message::Exec(exec.into(), None)),
|
||||
);
|
||||
content = content.push(menu_button(text::body(name)).on_press(
|
||||
Message::Exec(exec.into(), None, desktop_info.terminal()),
|
||||
));
|
||||
}
|
||||
content = content.push(divider::horizontal::light());
|
||||
}
|
||||
|
|
@ -2351,7 +2361,11 @@ fn launch_on_preferred_gpu(desktop_info: &DesktopEntry, gpus: Option<&[Gpu]>) ->
|
|||
}
|
||||
});
|
||||
|
||||
Some(Message::Exec(exec.to_string(), gpu_idx))
|
||||
Some(Message::Exec(
|
||||
exec.to_string(),
|
||||
gpu_idx,
|
||||
desktop_info.terminal(),
|
||||
))
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
|
|
|
|||
|
|
@ -157,6 +157,7 @@ struct ExecRequestData {
|
|||
data: RequestData,
|
||||
exec: String,
|
||||
gpu_idx: Option<usize>,
|
||||
terminal: bool,
|
||||
}
|
||||
|
||||
impl RequestDataExt for ExecRequestData {
|
||||
|
|
@ -181,6 +182,7 @@ impl ActivationHandler for AppData {
|
|||
app_id: data.app_id().map(|x| x.to_owned()),
|
||||
exec: data.exec.clone(),
|
||||
gpu_idx: data.gpu_idx,
|
||||
terminal: data.terminal,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -653,6 +655,7 @@ pub(crate) fn wayland_handler(
|
|||
app_id,
|
||||
exec,
|
||||
gpu_idx,
|
||||
terminal,
|
||||
} => {
|
||||
if let Some(activation_state) = state.activation_state.as_ref() {
|
||||
activation_state.request_token_with_data(
|
||||
|
|
@ -669,6 +672,7 @@ pub(crate) fn wayland_handler(
|
|||
},
|
||||
exec,
|
||||
gpu_idx,
|
||||
terminal,
|
||||
},
|
||||
);
|
||||
} else {
|
||||
|
|
@ -677,6 +681,7 @@ pub(crate) fn wayland_handler(
|
|||
app_id: Some(app_id),
|
||||
exec,
|
||||
gpu_idx,
|
||||
terminal,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ pub enum WaylandUpdate {
|
|||
app_id: Option<String>,
|
||||
exec: String,
|
||||
gpu_idx: Option<usize>,
|
||||
terminal: bool,
|
||||
},
|
||||
Image(ExtForeignToplevelHandleV1, WaylandImage),
|
||||
}
|
||||
|
|
@ -144,6 +145,7 @@ pub enum WaylandRequest {
|
|||
app_id: String,
|
||||
exec: String,
|
||||
gpu_idx: Option<usize>,
|
||||
terminal: bool,
|
||||
},
|
||||
Screencopy(ExtForeignToplevelHandleV1),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue