yoda: rebase onto libcosmic-yoda via path deps + macOS controls toggle

Fresh rewiring from upstream master (78644a3) — the previous attempt on
051f4f9 was 137 commits behind and hit API drift (cosmic::iced_futures,
Subscription::run_with_id). Upstream master uses the newer API
(cosmic::iced::stream + Subscription::run_with) which our libcosmic-yoda
already supports.

Yoda wiring:
- [workspace.dependencies.libcosmic] (git pop-os) -> libcosmic-yoda { path, wayland }
- cosmic-config + iced_winit workspace deps -> path to libcosmic-yoda submodule
- [patch.pop-os/libcosmic] redirects transitive cosmic-config + cosmic-theme +
  iced_futures + iced_winit to our local paths so the graph resolves to a
  single copy (cosmic-bg/comp/idle/panel configs unify cleanly against master)
- subscriptions/sound + page + cosmic-settings inner Cargo.toml: libcosmic ->
  libcosmic-yoda (workspace + direct variants)
- winit feature dropped from libcosmic-yoda deps (our fork is Wayland-only)

Cherry-picked from leyoda/local/window-controls-position @ 52ce463:
- cosmic-settings/src/pages/desktop/window_management.rs — macOS toggle UI
- i18n/en + fr/cosmic_settings.ftl — translations

Installed at /usr/bin/cosmic-settings (yoda build, 78 MB).
Pre-yoda pacman version kept at /usr/bin/cosmic-settings.pre-yoda-fork.
This commit is contained in:
Lionel DARNIS 2026-04-23 17:33:22 +02:00
parent 78644a32e3
commit 999e2ba4e5
8 changed files with 54 additions and 49 deletions

27
Cargo.lock generated
View file

@ -1391,7 +1391,6 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-config" name = "cosmic-config"
version = "1.0.0" version = "1.0.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"atomicwrites", "atomicwrites",
"cosmic-config-derive", "cosmic-config-derive",
@ -1412,7 +1411,6 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-config-derive" name = "cosmic-config-derive"
version = "1.0.0" version = "1.0.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.117", "syn 2.0.117",
@ -1588,7 +1586,7 @@ dependencies = [
"itertools 0.14.0", "itertools 0.14.0",
"itoa", "itoa",
"jiff", "jiff",
"libcosmic", "libcosmic-yoda",
"locale1", "locale1",
"locales-rs", "locales-rs",
"mime 0.3.17", "mime 0.3.17",
@ -1737,7 +1735,7 @@ version = "1.0.7"
dependencies = [ dependencies = [
"derive_setters", "derive_setters",
"downcast-rs 2.0.2", "downcast-rs 2.0.2",
"libcosmic", "libcosmic-yoda",
"regex", "regex",
"slab", "slab",
"slotmap", "slotmap",
@ -1762,7 +1760,7 @@ dependencies = [
"cosmic-pipewire", "cosmic-pipewire",
"futures", "futures",
"intmap", "intmap",
"libcosmic", "libcosmic-yoda",
"numtoa", "numtoa",
"rustix 1.1.4", "rustix 1.1.4",
"tokio", "tokio",
@ -1827,7 +1825,6 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-theme" name = "cosmic-theme"
version = "1.0.0" version = "1.0.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"almost", "almost",
"configparser", "configparser",
@ -3250,7 +3247,6 @@ dependencies = [
[[package]] [[package]]
name = "iced" name = "iced"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"dnd", "dnd",
"iced_accessibility", "iced_accessibility",
@ -3271,7 +3267,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_accessibility" name = "iced_accessibility"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"accesskit", "accesskit",
"accesskit_winit", "accesskit_winit",
@ -3280,7 +3275,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_core" name = "iced_core"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"bitflags 2.11.1", "bitflags 2.11.1",
"bytes", "bytes",
@ -3305,7 +3299,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_debug" name = "iced_debug"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"iced_core", "iced_core",
"iced_futures", "iced_futures",
@ -3315,7 +3308,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_futures" name = "iced_futures"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"futures", "futures",
"iced_core", "iced_core",
@ -3329,7 +3321,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_graphics" name = "iced_graphics"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"bitflags 2.11.1", "bitflags 2.11.1",
"bytemuck", "bytemuck",
@ -3350,7 +3341,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_program" name = "iced_program"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"iced_graphics", "iced_graphics",
"iced_runtime", "iced_runtime",
@ -3359,7 +3349,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_renderer" name = "iced_renderer"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"iced_graphics", "iced_graphics",
"iced_tiny_skia", "iced_tiny_skia",
@ -3371,7 +3360,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_runtime" name = "iced_runtime"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"bytes", "bytes",
"cosmic-client-toolkit", "cosmic-client-toolkit",
@ -3387,7 +3375,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_tiny_skia" name = "iced_tiny_skia"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"cosmic-text", "cosmic-text",
@ -3404,7 +3391,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_wgpu" name = "iced_wgpu"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"as-raw-xcb-connection", "as-raw-xcb-connection",
"bitflags 2.11.1", "bitflags 2.11.1",
@ -3435,7 +3421,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_widget" name = "iced_widget"
version = "0.14.2" version = "0.14.2"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"cosmic-client-toolkit", "cosmic-client-toolkit",
"dnd", "dnd",
@ -3455,7 +3440,6 @@ dependencies = [
[[package]] [[package]]
name = "iced_winit" name = "iced_winit"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"cosmic-client-toolkit", "cosmic-client-toolkit",
"cursor-icon", "cursor-icon",
@ -4565,9 +4549,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f"
[[package]] [[package]]
name = "libcosmic" name = "libcosmic-yoda"
version = "1.0.0" version = "0.1.0-yoda"
source = "git+https://github.com/pop-os/libcosmic#c423ad1bfc25057922406c687f2ddc75ead5ab67"
dependencies = [ dependencies = [
"apply", "apply",
"ashpd 0.12.3", "ashpd 0.12.3",

View file

@ -9,21 +9,23 @@ rust-version = "1.90"
[workspace.dependencies] [workspace.dependencies]
cosmic-randr = { git = "https://github.com/pop-os/cosmic-randr" } cosmic-randr = { git = "https://github.com/pop-os/cosmic-randr" }
tokio = { version = "1.49.0", features = ["macros"] } tokio = { version = "1.49.0", features = ["macros"] }
iced_winit = { git = "https://github.com/pop-os/libcosmic", default-features = false } # Yoda fork: direct path dep on iced_winit in libcosmic-yoda's submodule.
iced_winit = { path = "/home/lionel/Devels/libcosmic/iced/winit", default-features = false }
[workspace.dependencies.libcosmic] # Yoda fork — libcosmic-yoda by path, replaces upstream git dep.
[workspace.dependencies.libcosmic-yoda]
features = [ features = [
"dbus-config", "dbus-config",
"desktop", "desktop",
"multi-window", "multi-window",
"winit", "wayland",
"tokio", "tokio",
"qr_code", "qr_code",
] ]
git = "https://github.com/pop-os/libcosmic" path = "/home/lionel/Devels/libcosmic"
[workspace.dependencies.cosmic-config] [workspace.dependencies.cosmic-config]
git = "https://github.com/pop-os/libcosmic" path = "/home/lionel/Devels/libcosmic/cosmic-config"
[workspace.dependencies.cosmic-bg-config] [workspace.dependencies.cosmic-bg-config]
git = "https://github.com/pop-os/cosmic-bg" git = "https://github.com/pop-os/cosmic-bg"
@ -69,19 +71,15 @@ cosmic-client-toolkit = { git = "https://github.com/pop-os/cosmic-protocols//",
# [patch.'https://github.com/pop-os/cosmic-settings-daemon'] # [patch.'https://github.com/pop-os/cosmic-settings-daemon']
# cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon//", branch = "input_nobuild" } # cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon//", branch = "input_nobuild" }
# For development and testing purposes # Yoda fork: redirect every transitive dep that asks for pop-os/libcosmic
# [patch.'https://github.com/pop-os/libcosmic'] # (cosmic-bg-config, cosmic-comp-config, cosmic-idle-config, cosmic-panel-config,
# libcosmic = { path = "../libcosmic" } # cosmic-settings-config, cosmic-settings-daemon-config) to our local paths so
# cosmic-config = { path = "../libcosmic/cosmic-config" } # the whole graph resolves against a single cosmic-config / cosmic-theme / iced_*.
# cosmic-theme = { path = "../libcosmic/cosmic-theme" } [patch.'https://github.com/pop-os/libcosmic']
# iced_futures = { path = "../libcosmic/iced/futures" } cosmic-config = { path = "/home/lionel/Devels/libcosmic/cosmic-config" }
# iced_winit = { path = "../libcosmic/iced/winit" } cosmic-theme = { path = "/home/lionel/Devels/libcosmic/cosmic-theme" }
iced_futures = { path = "/home/lionel/Devels/libcosmic/iced/futures" }
# libcosmic = { git = "https://github.com/pop-os/libcosmic//" } iced_winit = { path = "/home/lionel/Devels/libcosmic/iced/winit" }
# cosmic-config = { git = "https://github.com/pop-os/libcosmic//" }
# cosmic-theme = { git = "https://github.com/pop-os/libcosmic//" }
# iced_futures = { git = "https://github.com/pop-os/libcosmic//" }
# iced_winit = { git = "https://github.com/pop-os/libcosmic//" }
# [patch.'https://github.com/pop-os/dbus-settings-bindings'] # [patch.'https://github.com/pop-os/dbus-settings-bindings']
# cosmic-dbus-networkmanager = { path = "../dbus-settings-bindings/networkmanager" } # cosmic-dbus-networkmanager = { path = "../dbus-settings-bindings/networkmanager" }

View file

@ -59,7 +59,7 @@ image = { version = "0.25", default-features = false, features = [
indexmap = "2.13.0" indexmap = "2.13.0"
itertools = "0.14.0" itertools = "0.14.0"
itoa = "1.0.17" itoa = "1.0.17"
libcosmic.workspace = true libcosmic-yoda.workspace = true
iced_winit.workspace = true iced_winit.workspace = true
locale1 = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } locale1 = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true }
sysinfo = { version = "=0.38.0", optional = true } sysinfo = { version = "=0.38.0", optional = true }
@ -187,12 +187,12 @@ page-window-management = ["cosmic-comp-config", "dep:cosmic-settings-config"]
page-workspaces = ["cosmic-comp-config"] page-workspaces = ["cosmic-comp-config"]
# Other features # Other features
a11y = ["libcosmic/a11y"] a11y = ["libcosmic-yoda/a11y"]
ashpd = ["dep:ashpd"] ashpd = ["dep:ashpd"]
cosmic-comp-config = ["dep:cosmic-comp-config"] cosmic-comp-config = ["dep:cosmic-comp-config"]
dbus-config = ["libcosmic/dbus-config", "cosmic-config/dbus"] dbus-config = ["libcosmic-yoda/dbus-config", "cosmic-config/dbus"]
single-instance = ["libcosmic/single-instance"] single-instance = ["libcosmic-yoda/single-instance"]
test = [] test = []
wayland = ["libcosmic/wayland", "dep:cosmic-panel-config", "dep:cosmic-randr", "iced_winit/cctk"] wayland = ["libcosmic-yoda/wayland", "dep:cosmic-panel-config", "dep:cosmic-randr", "iced_winit/cctk"]
wgpu = ["libcosmic/wgpu"] wgpu = ["libcosmic-yoda/wgpu"]
xdg-portal = ["ashpd", "libcosmic/xdg-portal"] xdg-portal = ["ashpd", "libcosmic-yoda/xdg-portal"]

View file

@ -27,6 +27,7 @@ pub enum Message {
ShowActiveWindowHint(bool), ShowActiveWindowHint(bool),
ShowMaximizeButton(bool), ShowMaximizeButton(bool),
ShowMinimizeButton(bool), ShowMinimizeButton(bool),
WindowControlsPositionStart(bool),
SetEdgeSnapThreshold(u32), SetEdgeSnapThreshold(u32),
Surface(surface::Action), Surface(surface::Action),
} }
@ -177,6 +178,19 @@ impl Page {
.set_show_minimize(&config, value); .set_show_minimize(&config, value);
} }
} }
Message::WindowControlsPositionStart(left) => {
if let Ok(config) = cosmic::config::CosmicTk::config() {
let position = if left {
cosmic::widget::WindowControlsPosition::Start
} else {
cosmic::widget::WindowControlsPosition::End
};
let _res = cosmic::config::COSMIC_TK
.write()
.unwrap()
.set_window_controls_position(&config, position);
}
}
Message::ShowActiveWindowHint(value) => { Message::ShowActiveWindowHint(value) => {
self.show_active_hint = value; self.show_active_hint = value;
if let Err(err) = self.comp_config.set("active_hint", value) { if let Err(err) = self.comp_config.set("active_hint", value) {
@ -274,6 +288,7 @@ pub fn window_controls() -> Section<crate::pages::Message> {
maximize = fl!("window-controls", "maximize"); maximize = fl!("window-controls", "maximize");
minimize = fl!("window-controls", "minimize"); minimize = fl!("window-controls", "minimize");
active_window_hint = fl!("window-controls", "active-window-hint"); active_window_hint = fl!("window-controls", "active-window-hint");
position_start = fl!("window-controls", "position-start");
}); });
Section::default() Section::default()
@ -296,6 +311,13 @@ pub fn window_controls() -> Section<crate::pages::Message> {
settings::item::builder(&descriptions[minimize]) settings::item::builder(&descriptions[minimize])
.toggler(cosmic::config::show_minimize(), Message::ShowMinimizeButton), .toggler(cosmic::config::show_minimize(), Message::ShowMinimizeButton),
) )
.add(settings::item::builder(&descriptions[position_start]).toggler(
matches!(
cosmic::config::window_controls_position(),
cosmic::widget::WindowControlsPosition::Start
),
Message::WindowControlsPositionStart,
))
.apply(Element::from) .apply(Element::from)
.map(crate::pages::Message::WindowManagement) .map(crate::pages::Message::WindowManagement)
}) })

View file

@ -484,6 +484,7 @@ window-controls = Window controls
.maximize = Show maximize button .maximize = Show maximize button
.minimize = Show minimize button .minimize = Show minimize button
.active-window-hint = Show active window hint .active-window-hint = Show active window hint
.position-start = Place buttons on the left (macOS style)
focus-navigation = Focus navigation focus-navigation = Focus navigation
.focus-follows-cursor = Focus follows cursor .focus-follows-cursor = Focus follows cursor

View file

@ -322,6 +322,7 @@ window-controls = Contrôles des fenêtres
.maximize = Afficher le bouton maximiser .maximize = Afficher le bouton maximiser
.minimize = Afficher le bouton minimiser .minimize = Afficher le bouton minimiser
.active-window-hint = Afficher l'indice de la fenêtre active .active-window-hint = Afficher l'indice de la fenêtre active
.position-start = Placer les boutons à gauche (style macOS)
focus-navigation = Navigation par le focus focus-navigation = Navigation par le focus
.focus-follows-cursor = Le focus suit le curseur .focus-follows-cursor = Le focus suit le curseur
.focus-follows-cursor-delay = Délai de suivi du focus en ms .focus-follows-cursor-delay = Délai de suivi du focus en ms

View file

@ -7,7 +7,7 @@ edition = "2024"
derive_setters = "0.1.9" derive_setters = "0.1.9"
regex = "1.12.3" regex = "1.12.3"
slotmap = "1.1.1" slotmap = "1.1.1"
libcosmic = { workspace = true } libcosmic-yoda = { workspace = true }
downcast-rs = "2.0.2" downcast-rs = "2.0.2"
url = "2.5.8" url = "2.5.8"
slab = "0.4.12" slab = "0.4.12"

View file

@ -10,7 +10,7 @@ publish = true
cosmic-pipewire = { path = "../../crates/cosmic-pipewire" } cosmic-pipewire = { path = "../../crates/cosmic-pipewire" }
futures = "0.3.32" futures = "0.3.32"
intmap = "3.1.3" intmap = "3.1.3"
libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } libcosmic-yoda = { path = "/home/lionel/Devels/libcosmic", default-features = false }
numtoa = "1.0.0-alpha1" numtoa = "1.0.0-alpha1"
rustix = "1.1.3" rustix = "1.1.3"
tokio = { version = "1.49.0", features = ["process", "rt", "time"] } tokio = { version = "1.49.0", features = ["process", "rt", "time"] }