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"
|
once_cell = "1"
|
||||||
rust-embed = "8.5"
|
rust-embed = "8.5"
|
||||||
rust-embed-utils = "8.5.0"
|
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"] }
|
zbus = { version = "5.7.1", default-features = false, features = ["tokio"] }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
|
||||||
tracing-log = "0.2.0"
|
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" }
|
cosmic-config = { git = "https://github.com/pop-os/libcosmic" }
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.219", features = ["derive"] }
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = "s"
|
opt-level = "s"
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
lto = "off"
|
lto = "thin"
|
||||||
|
|
||||||
[workspace.metadata.cargo-machete]
|
[workspace.metadata.cargo-machete]
|
||||||
ignored = ["libcosmic"]
|
ignored = ["libcosmic"]
|
||||||
|
|
|
||||||
|
|
@ -369,7 +369,7 @@ enum Message {
|
||||||
ClosePopup,
|
ClosePopup,
|
||||||
Activate(ExtForeignToplevelHandleV1),
|
Activate(ExtForeignToplevelHandleV1),
|
||||||
Toggle(ExtForeignToplevelHandleV1),
|
Toggle(ExtForeignToplevelHandleV1),
|
||||||
Exec(String, Option<usize>),
|
Exec(String, Option<usize>, bool),
|
||||||
Quit(String),
|
Quit(String),
|
||||||
NewSeat(WlSeat),
|
NewSeat(WlSeat),
|
||||||
RemovedSeat,
|
RemovedSeat,
|
||||||
|
|
@ -1237,6 +1237,7 @@ impl cosmic::Application for CosmicAppList {
|
||||||
app_id,
|
app_id,
|
||||||
exec,
|
exec,
|
||||||
gpu_idx,
|
gpu_idx,
|
||||||
|
terminal,
|
||||||
} => {
|
} => {
|
||||||
let mut envs = Vec::new();
|
let mut envs = Vec::new();
|
||||||
if let Some(token) = token {
|
if let Some(token) = token {
|
||||||
|
|
@ -1252,7 +1253,13 @@ impl cosmic::Application for CosmicAppList {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
tokio::spawn(async move {
|
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 => {
|
Message::RemovedSeat => {
|
||||||
self.seat.take();
|
self.seat.take();
|
||||||
}
|
}
|
||||||
Message::Exec(exec, gpu_idx) => {
|
Message::Exec(exec, gpu_idx, terminal) => {
|
||||||
if let Some(tx) = self.wayland_sender.as_ref() {
|
if let Some(tx) = self.wayland_sender.as_ref() {
|
||||||
let _ = tx.send(WaylandRequest::TokenRequest {
|
let _ = tx.send(WaylandRequest::TokenRequest {
|
||||||
app_id: Self::APP_ID.to_string(),
|
app_id: Self::APP_ID.to_string(),
|
||||||
exec,
|
exec,
|
||||||
gpu_idx,
|
gpu_idx,
|
||||||
|
terminal,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1824,10 +1832,10 @@ impl cosmic::Application for CosmicAppList {
|
||||||
|
|
||||||
if let Some(exec) = desktop_info.exec() {
|
if let Some(exec) = desktop_info.exec() {
|
||||||
if !toplevels.is_empty() {
|
if !toplevels.is_empty() {
|
||||||
content = content.push(
|
content =
|
||||||
menu_button(text::body(fl!("new-window")))
|
content.push(menu_button(text::body(fl!("new-window"))).on_press(
|
||||||
.on_press(Message::Exec(exec.to_string(), None)),
|
Message::Exec(exec.to_string(), None, desktop_info.terminal()),
|
||||||
);
|
));
|
||||||
} else if let Some(gpus) = self.gpus.as_ref() {
|
} else if let Some(gpus) = self.gpus.as_ref() {
|
||||||
let default_idx = if desktop_info.prefers_non_default_gpu() {
|
let default_idx = if desktop_info.prefers_non_default_gpu() {
|
||||||
gpus.iter().position(|gpu| !gpu.default).unwrap_or(0)
|
gpus.iter().position(|gpu| !gpu.default).unwrap_or(0)
|
||||||
|
|
@ -1845,14 +1853,17 @@ impl cosmic::Application for CosmicAppList {
|
||||||
String::new()
|
String::new()
|
||||||
}
|
}
|
||||||
)))
|
)))
|
||||||
.on_press(Message::Exec(exec.to_string(), Some(i))),
|
.on_press(Message::Exec(
|
||||||
|
exec.to_string(),
|
||||||
|
Some(i),
|
||||||
|
desktop_info.terminal(),
|
||||||
|
)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
content = content.push(
|
content = content.push(menu_button(text::body(fl!("run"))).on_press(
|
||||||
menu_button(text::body(fl!("run")))
|
Message::Exec(exec.to_string(), None, desktop_info.terminal()),
|
||||||
.on_press(Message::Exec(exec.to_string(), None)),
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
for action in desktop_info.actions().into_iter().flatten() {
|
for action in desktop_info.actions().into_iter().flatten() {
|
||||||
if action == "new-window" {
|
if action == "new-window" {
|
||||||
|
|
@ -1867,10 +1878,9 @@ impl cosmic::Application for CosmicAppList {
|
||||||
else {
|
else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
content = content.push(
|
content = content.push(menu_button(text::body(name)).on_press(
|
||||||
menu_button(text::body(name))
|
Message::Exec(exec.into(), None, desktop_info.terminal()),
|
||||||
.on_press(Message::Exec(exec.into(), None)),
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
content = content.push(divider::horizontal::light());
|
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)]
|
#[derive(Debug, Default, Clone)]
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,7 @@ struct ExecRequestData {
|
||||||
data: RequestData,
|
data: RequestData,
|
||||||
exec: String,
|
exec: String,
|
||||||
gpu_idx: Option<usize>,
|
gpu_idx: Option<usize>,
|
||||||
|
terminal: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RequestDataExt for ExecRequestData {
|
impl RequestDataExt for ExecRequestData {
|
||||||
|
|
@ -181,6 +182,7 @@ impl ActivationHandler for AppData {
|
||||||
app_id: data.app_id().map(|x| x.to_owned()),
|
app_id: data.app_id().map(|x| x.to_owned()),
|
||||||
exec: data.exec.clone(),
|
exec: data.exec.clone(),
|
||||||
gpu_idx: data.gpu_idx,
|
gpu_idx: data.gpu_idx,
|
||||||
|
terminal: data.terminal,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -653,6 +655,7 @@ pub(crate) fn wayland_handler(
|
||||||
app_id,
|
app_id,
|
||||||
exec,
|
exec,
|
||||||
gpu_idx,
|
gpu_idx,
|
||||||
|
terminal,
|
||||||
} => {
|
} => {
|
||||||
if let Some(activation_state) = state.activation_state.as_ref() {
|
if let Some(activation_state) = state.activation_state.as_ref() {
|
||||||
activation_state.request_token_with_data(
|
activation_state.request_token_with_data(
|
||||||
|
|
@ -669,6 +672,7 @@ pub(crate) fn wayland_handler(
|
||||||
},
|
},
|
||||||
exec,
|
exec,
|
||||||
gpu_idx,
|
gpu_idx,
|
||||||
|
terminal,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -677,6 +681,7 @@ pub(crate) fn wayland_handler(
|
||||||
app_id: Some(app_id),
|
app_id: Some(app_id),
|
||||||
exec,
|
exec,
|
||||||
gpu_idx,
|
gpu_idx,
|
||||||
|
terminal,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,7 @@ pub enum WaylandUpdate {
|
||||||
app_id: Option<String>,
|
app_id: Option<String>,
|
||||||
exec: String,
|
exec: String,
|
||||||
gpu_idx: Option<usize>,
|
gpu_idx: Option<usize>,
|
||||||
|
terminal: bool,
|
||||||
},
|
},
|
||||||
Image(ExtForeignToplevelHandleV1, WaylandImage),
|
Image(ExtForeignToplevelHandleV1, WaylandImage),
|
||||||
}
|
}
|
||||||
|
|
@ -144,6 +145,7 @@ pub enum WaylandRequest {
|
||||||
app_id: String,
|
app_id: String,
|
||||||
exec: String,
|
exec: String,
|
||||||
gpu_idx: Option<usize>,
|
gpu_idx: Option<usize>,
|
||||||
|
terminal: bool,
|
||||||
},
|
},
|
||||||
Screencopy(ExtForeignToplevelHandleV1),
|
Screencopy(ExtForeignToplevelHandleV1),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue