diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7897eb01..5a5258f3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -6,26 +6,20 @@ on:
- master
pull_request:
-
jobs:
format:
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
steps:
- name: Checkout sources
- uses: actions/checkout@v3
+ uses: actions/checkout@v6
- name: Rust toolchain
- uses: dtolnay/rust-toolchain@stable
+ uses: actions-rust-lang/setup-rust-toolchain@v1
with:
+ toolchain: nightly
components: rustfmt
- - name: Cargo cache
- uses: actions/cache@v3
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- key: ${{ runner.os }}-cargo-rust_stable-${{ hashFiles('**/Cargo.toml') }}
+ rustflags: ""
- name: Format
- run: cargo fmt -- --check
+ run: cargo +nightly fmt -- --check
tests:
needs:
@@ -34,38 +28,28 @@ jobs:
fail-fast: false
matrix:
test_args:
- - --no-default-features --features "" # for cosmic-comp, don't remove!
- - --no-default-features --features "winit_debug"
- - --no-default-features --features "winit_tokio"
- - --no-default-features --features "winit"
- - --no-default-features --features "winit_wgpu"
- - --no-default-features --features "wayland"
- - --no-default-features --features "applet"
- - --no-default-features --features "desktop,smol"
- - --no-default-features --features "desktop,tokio"
- - -p cosmic-theme
- runs-on: ubuntu-22.04
+ - --no-default-features --features "" # for cosmic-comp, don't remove!
+ - --no-default-features --features "winit_debug"
+ - --no-default-features --features "winit_tokio"
+ - --no-default-features --features "winit"
+ - --no-default-features --features "winit_wgpu"
+ - --no-default-features --features "wayland"
+ - --no-default-features --features "applet"
+ - --no-default-features --features "desktop,smol"
+ - --no-default-features --features "desktop,tokio"
+ - -p cosmic-theme
+ runs-on: ubuntu-latest
steps:
- name: Checkout sources
- uses: actions/checkout@v3
+ uses: actions/checkout@v6
with:
submodules: recursive
- - name: Get date for registry cache
- id: date
- run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- - name: Cargo registry cache
- uses: actions/cache@v3
- with:
- path: |
- ~/.cargo/registry/index
- ~/.cargo/registry/cache
- ~/.cargo/git
- key: ${{ runner.os }}-cargo-registry-${{ steps.date.outputs.date }}
- restore-keys: ${{ runner.os }}-cargo-registry-
- name: System dependencies
run: sudo apt-get update; sudo apt-get install -y libxkbcommon-dev libwayland-dev
- name: Rust toolchain
- uses: dtolnay/rust-toolchain@stable
+ uses: actions-rust-lang/setup-rust-toolchain@v1
+ with:
+ rustflags: ""
- name: Test features
run: cargo test ${{ matrix.test_args }} -- --test-threads=1
env:
@@ -82,28 +66,18 @@ jobs:
- "open-dialog"
- "context-menu"
- "nav-context"
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
steps:
- name: Checkout sources
- uses: actions/checkout@v3
+ uses: actions/checkout@v6
with:
submodules: recursive
- - name: Get date for registry cache
- id: date
- run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- - name: Cargo registry cache
- uses: actions/cache@v3
- with:
- path: |
- ~/.cargo/registry/index
- ~/.cargo/registry/cache
- ~/.cargo/git
- key: ${{ runner.os }}-cargo-registry-${{ steps.date.outputs.date }}
- restore-keys: ${{ runner.os }}-cargo-registry-
- name: System dependencies
run: sudo apt-get update; sudo apt-get install -y libxkbcommon-dev libwayland-dev
- name: Rust toolchain
- uses: dtolnay/rust-toolchain@stable
+ uses: actions-rust-lang/setup-rust-toolchain@v1
+ with:
+ rustflags: ""
- name: Check example
run: cargo check -p "${{ matrix.examples }}"
env:
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
index 3e3a042e..e51c552f 100644
--- a/.github/workflows/pages.yml
+++ b/.github/workflows/pages.yml
@@ -11,25 +11,26 @@ jobs:
steps:
- name: Checkout sources
- uses: actions/checkout@v3
+ uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Rust nightly
- uses: dtolnay/rust-toolchain@master
+ uses: actions-rust-lang/setup-rust-toolchain@v1
with:
- toolchain: nightly-2025-07-31
+ toolchain: nightly-2026-04-27
+ rustflags: ""
- name: System dependencies
run: sudo apt-get update; sudo apt-get install -y libxkbcommon-dev libwayland-dev
- name: Build documentation
run: |
RUSTDOCFLAGS="--cfg docsrs" \
- cargo +nightly-2025-07-31 doc --no-deps \
+ cargo +nightly-2026-04-27 doc --no-deps \
-p cosmic-client-toolkit \
-p cosmic-protocols \
-p libcosmic \
--verbose --features tokio,winit,wayland,desktop,single-instance,applet,xdg-portal,multi-window
- name: Deploy documentation
- uses: peaceiris/actions-gh-pages@v3
+ uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
diff --git a/.zed/settings.json b/.zed/settings.json
new file mode 100644
index 00000000..2cc7b98d
--- /dev/null
+++ b/.zed/settings.json
@@ -0,0 +1,15 @@
+{
+ "format_on_save": "on",
+ "lsp": {
+ "rust-analyzer": {
+ "initialization_options": {
+ "check": {
+ "command": "clippy",
+ },
+ "rustfmt": {
+ "extraArgs": ["+nightly"],
+ },
+ },
+ },
+ },
+}
diff --git a/Cargo.toml b/Cargo.toml
index d73da2dc..23ceccb3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,20 +1,23 @@
[package]
-name = "libcosmic"
-version = "1.0.0"
+# Yoda fork: hard-renamed. Every consumer (leyoda/cosmic-files fork + each
+# leyoda/cosmic-* app) depends directly on `libcosmic-yoda` by path, bypassing
+# pop-os/libcosmic entirely. No [patch] shenanigans needed — transitive deps
+# that used to ask for `libcosmic` are replaced by deps on our forks that ask
+# for `libcosmic-yoda`.
+name = "libcosmic-yoda"
+version = "0.1.0-yoda.2"
edition = "2024"
-rust-version = "1.90"
+rust-version = "1.93"
[lib]
name = "cosmic"
[features]
default = [
- "winit",
"tokio",
"a11y",
"dbus-config",
- "x11",
- "iced-wayland",
+ "wayland",
"multi-window",
]
advanced-shaping = ["iced/advanced-shaping"]
@@ -35,7 +38,6 @@ animated-image = [
autosize = []
applet = [
"autosize",
- "winit",
"wayland",
"tokio",
"cosmic-panel-config",
@@ -72,6 +74,7 @@ serde-keycode = ["iced_core/serde"]
single-instance = ["zbus/blocking-api", "ron"]
# smol async runtime
smol = ["dep:smol", "iced/smol", "zbus?/async-io", "rfd?/async-std"]
+# Tokio async runtime
tokio = [
"dep:tokio",
"ashpd?/tokio",
@@ -81,20 +84,25 @@ tokio = [
"cosmic-config/tokio",
]
# Tokio async runtime
-# Wayland window support
-iced-wayland = [
+# Wayland window support (yoda fork is Wayland-only; always active in default).
+# We still need iced/winit because pop-os/iced hosts the runtime dispatcher
+# (`iced_winit as shell`) there — the name is a misnomer, it's the same crate
+# that provides both the winit path AND the sctk/cctk wayland path.
+# COSMIC 1.5/1.6 renamed the iced `cctk` features to `wayland`; the local
+# `winit` feature stays empty in this fork, so iced/winit is listed explicitly
+# instead of going through it.
+wayland = [
"ashpd?/wayland",
"autosize",
+ "multi-window",
+ "surface-message",
+ "winit",
+ "iced/winit",
"iced/wayland",
"iced_winit/wayland",
- "surface-message",
-]
-wayland = [
- "iced-wayland",
- "iced_runtime/cctk",
- "iced_winit/cctk",
- "iced_wgpu/cctk",
- "iced/cctk",
+ "iced_runtime/wayland",
+ "iced_wgpu/wayland",
+ "dep:iced_winit",
"dep:cctk",
]
surface-message = []
@@ -102,11 +110,11 @@ surface-message = []
multi-window = []
# Render with wgpu
wgpu = ["iced/wgpu", "iced_wgpu"]
-# X11 window support via winit
-winit = ["iced/winit", "iced_winit"]
-winit_debug = ["winit", "debug"]
-winit_tokio = ["winit", "tokio"]
-winit_wgpu = ["winit", "wgpu"]
+# Compat stubs — kept empty so upstream deps (cosmic-files, cosmic-text, …)
+# that still ask for `winit` / `x11` features resolve cleanly against the
+# yoda fork. Activating them has no effect: no code is gated on these.
+winit = []
+x11 = []
# Enables XDG portal integrations
xdg-portal = ["ashpd"]
qr_code = ["iced/qr_code"]
@@ -119,18 +127,15 @@ async-std = [
"zbus?/async-io",
"iced/async-std",
]
-x11 = ["iced/x11", "iced_winit/x11"]
[dependencies]
apply = "0.3.0"
-ashpd = { version = "0.12.3", default-features = false, optional = true }
async-fs = { version = "2.2", optional = true }
-async-std = { version = "1.13", optional = true }
+async-std = { workspace = true, optional = true }
auto_enums = "0.8.8"
-cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "160b086", optional = true }
jiff = "0.2"
cosmic-config = { path = "cosmic-config" }
-cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon", optional = true }
+cosmic-settings-config = { path = "../cosmic-settings-daemon/config", optional = true }
# Internationalization
i18n-embed = { version = "0.16.0", features = [
"fluent-system",
@@ -150,34 +155,39 @@ image-extras = { version = "0.1.0", default-features = false, features = [
"xpm",
"xbm",
], optional = true }
-libc = { version = "0.2.183", optional = true }
+libc = { version = "0.2.186", optional = true }
log = "0.4"
mime = { version = "0.3.17", optional = true }
-palette = "0.7.6"
+palette.workspace = true
rfd = { version = "0.16.0", default-features = false, features = [
"xdg-portal",
], optional = true }
rustix = { version = "1.1", features = ["pipe", "process"], optional = true }
-serde = { version = "1.0.228", features = ["derive"] }
+serde = { workspace = true, features = ["derive"] }
slotmap = "1.1.1"
smol = { version = "2.0.2", optional = true }
-thiserror = "2.0.18"
+thiserror.workspace = true
taffy = { version = "0.9.2", features = ["grid"] }
-tokio = { version = "1.50.0", optional = true }
-tracing = "0.1.44"
-unicode-segmentation = "1.12"
+tokio = { workspace = true, optional = true }
+tracing.workspace = true
+unicode-segmentation = "1.13"
url = "2.5.8"
-zbus = { version = "5.14.0", default-features = false, optional = true }
+zbus = { workspace = true, optional = true }
float-cmp = "0.10.0"
+ron = { workspace = true, optional = true }
+enumflags2 = "0.7.12"
+roxmltree = "0.20"
# Enable DBus feature on Linux targets
-[target.'cfg(target_os = "linux")'.dependencies]
+[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_vendor = "apple"))))'.dependencies]
+cctk = { path = "../cosmic-protocols/client-toolkit", package = "cosmic-client-toolkit", optional = true }
+ashpd = { version = "0.12.3", default-features = false, optional = true }
cosmic-config = { path = "cosmic-config", features = ["dbus"] }
-cosmic-settings-daemon = { git = "https://github.com/pop-os/dbus-settings-bindings" }
+cosmic-settings-daemon = { path = "../dbus-settings-bindings/cosmic-settings-daemon" }
zbus = { version = "5.14.0", default-features = false }
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
-freedesktop-icons = { package = "cosmic-freedesktop-icons", git = "https://github.com/pop-os/freedesktop-icons" }
+freedesktop-icons = { package = "cosmic-freedesktop-icons", path = "../cosmic-freedesktop-icons" }
freedesktop-desktop-entry = { version = "0.8.1", optional = true }
shlex = { version = "1.3.0", optional = true }
@@ -223,35 +233,83 @@ optional = true
[dependencies.iced_tiny_skia]
path = "./iced/tiny_skia"
+# Yoda: drop the x11 default → softbuffer no longer pulls tiny-xlib/x11-dl/etc.
+default-features = false
+features = ["wayland"]
[dependencies.iced_winit]
path = "./iced/winit"
optional = true
+# Yoda: drop the x11 default → winit won't pull winit-x11/tiny-xlib/x11-dl.
+# Keep wayland + wayland-dlopen (default behaviour minus x11).
+default-features = false
+features = ["wayland", "wayland-dlopen"]
[dependencies.iced_wgpu]
path = "./iced/wgpu"
optional = true
[dependencies.cosmic-panel-config]
-git = "https://github.com/pop-os/cosmic-panel"
-# path = "../cosmic-panel/cosmic-panel-config"
+path = "../cosmic-panel/cosmic-panel-config"
optional = true
-[dependencies.ron]
-version = "0.12"
-optional = true
+[patch.'https://github.com/pop-os/freedesktop-icons']
+cosmic-freedesktop-icons = { path = "../cosmic-freedesktop-icons" }
+
+[patch.'https://github.com/pop-os/softbuffer']
+softbuffer = { path = "../softbuffer" }
+
+[patch.'https://github.com/pop-os/smithay-clipboard']
+smithay-clipboard = { path = "../smithay-clipboard" }
+
+[patch.'https://github.com/pop-os/winit.git']
+dpi = { path = "../winit/dpi" }
+winit = { path = "../winit/winit" }
+winit-android = { path = "../winit/winit-android" }
+winit-appkit = { path = "../winit/winit-appkit" }
+winit-common = { path = "../winit/winit-common" }
+winit-core = { path = "../winit/winit-core" }
+winit-orbital = { path = "../winit/winit-orbital" }
+winit-uikit = { path = "../winit/winit-uikit" }
+winit-wayland = { path = "../winit/winit-wayland" }
+winit-web = { path = "../winit/winit-web" }
+winit-win32 = { path = "../winit/winit-win32" }
+winit-x11 = { path = "../winit/winit-x11" }
[workspace]
members = [
"cosmic-config",
"cosmic-config-derive",
"cosmic-theme",
- "examples/*",
]
-exclude = ["iced"]
+# examples/* excluded — many depend on the removed winit/x11 features.
+# They will be revisited and adapted in a later phase.
+exclude = ["iced", "examples"]
[workspace.dependencies]
-dirs = "6.0.0"
+async-std = "1.13"
+dirs = "6.0"
+palette = "0.7"
+ron = "0.12"
+serde = "1.0"
+thiserror = "2.0"
+tracing = "0.1"
+tokio = "1.52"
+zbus = { version = "5.15", default-features = false }
+
+# Speed up snapshot diffing in cosmic-theme tests. Cargo silently ignores
+# [profile.*] blocks in non-root manifests, so this lives at the
+# workspace root.
+[profile.dev.package.insta]
+opt-level = 3
+[profile.dev.package.similar]
+opt-level = 3
[dev-dependencies]
tempfile = "3.27.0"
+
+[workspace.package]
+edition = "2024"
+
+[build-dependencies]
+build_helpers = { path = "./iced/build_helpers" }
diff --git a/README.md b/README.md
index 23da97bc..698316db 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,24 @@ While libcosmic is written entirely in Rust, some of its dependencies may requir
sudo apt install cargo cmake just libexpat1-dev libfontconfig-dev libfreetype-dev libxkbcommon-dev pkgconf
```
+## Made-for-COSMIC Flatpak IDs
+
+To identify a project as a COSMIC Application, add `com.system76.CosmicApplication` to the provides section of the project's metainfo.
+
+```xml
+
+ com.system76.CosmicApplication
+
+```
+
+For COSMIC Applets, use `com.system76.CosmicApplet`.
+
+```xml
+
+ com.system76.CosmicApplet
+
+```
+
## Examples
Some examples are included in the [examples](./examples) directory to to kickstart your
diff --git a/build.rs b/build.rs
index 4ce0aa9e..722d2c57 100644
--- a/build.rs
+++ b/build.rs
@@ -8,6 +8,7 @@ fn main() {
{
generate_bundled_icons();
}
+ build_helpers::cfg_aliases_setup();
}
fn generate_bundled_icons() {
diff --git a/cosmic-config-derive/src/lib.rs b/cosmic-config-derive/src/lib.rs
index cc19a91e..1ca2a3f6 100644
--- a/cosmic-config-derive/src/lib.rs
+++ b/cosmic-config-derive/src/lib.rs
@@ -1,17 +1,31 @@
use proc_macro::TokenStream;
use quote::quote;
-use syn::{self};
-#[proc_macro_derive(CosmicConfigEntry, attributes(version, id))]
+#[proc_macro_derive(CosmicConfigEntry, attributes(version, id, cosmic_config_entry))]
pub fn cosmic_config_entry_derive(input: TokenStream) -> TokenStream {
- // Construct a representation of Rust code as a syntax tree
- // that we can manipulate
let ast = syn::parse(input).unwrap();
-
- // Build the trait implementation
impl_cosmic_config_entry_macro(&ast)
}
+fn get_cosmic_config_attrs(field: &syn::Field) -> Result