From 9c1306d8c7e0da6cbcd99d6350986cbf65a348c2 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 6 Aug 2025 21:41:38 -0400 Subject: [PATCH] feat: accessibility menu --- Cargo.lock | 676 +++++++++++++++++++++---------------- Cargo.toml | 19 +- i18n/en/cosmic_greeter.ftl | 5 + src/greeter.rs | 165 ++++++++- src/lib.rs | 4 + src/state.rs | 8 + src/wayland/mod.rs | 86 +++++ 7 files changed, 658 insertions(+), 305 deletions(-) create mode 100644 src/state.rs create mode 100644 src/wayland/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 4bcf673..3c36d2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "ab_glyph" -version = "0.2.29" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3672c180e71eeaaac3a541fbbc5f5ad4def8b747c595ad30d674e43049f7b0" +checksum = "e074464580a518d16a7126262fffaaa47af89d4099d4cb403f8ed938ba12ee7d" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", @@ -14,9 +14,9 @@ dependencies = [ [[package]] name = "ab_glyph_rasterizer" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" +checksum = "b2187590a23ab1e3df8681afdf0987c48504d80291f002fcdb651f0ef5e25169" [[package]] name = "accesskit" @@ -252,7 +252,7 @@ dependencies = [ "enumflags2", "futures-channel", "futures-util", - "rand 0.9.1", + "rand 0.9.2", "raw-window-handle", "serde", "serde_repr", @@ -261,7 +261,7 @@ dependencies = [ "wayland-backend", "wayland-client", "wayland-protocols", - "zbus 5.7.1", + "zbus 5.9.0", ] [[package]] @@ -280,7 +280,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" dependencies = [ - "event-listener 5.4.0", + "event-listener 5.4.1", "event-listener-strategy", "futures-core", "pin-project-lite", @@ -288,9 +288,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" dependencies = [ "concurrent-queue", "event-listener-strategy", @@ -307,7 +307,7 @@ dependencies = [ "async-task", "concurrent-queue", "fastrand 2.3.0", - "futures-lite 2.6.0", + "futures-lite 2.6.1", "pin-project-lite", "slab", ] @@ -344,21 +344,20 @@ dependencies = [ [[package]] name = "async-io" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1237c0ae75a0f3765f58910ff9cdd0a12eeb39ab2f4c7de23262f337f0aacbb3" +checksum = "19634d6336019ef220f09fd31168ce5c184b295cbf80345437cc36094ef223ca" dependencies = [ - "async-lock 3.4.0", + "async-lock 3.4.1", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.6.0", + "futures-lite 2.6.1", "parking", - "polling 3.8.0", - "rustix 1.0.7", + "polling 3.10.0", + "rustix 1.0.8", "slab", - "tracing", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -372,11 +371,11 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.4.0" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" dependencies = [ - "event-listener 5.4.0", + "event-listener 5.4.1", "event-listener-strategy", "pin-project-lite", ] @@ -400,21 +399,20 @@ dependencies = [ [[package]] name = "async-process" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde3f4e40e6021d7acffc90095cbd6dc54cb593903d1de5832f435eb274b85dc" +checksum = "65daa13722ad51e6ab1a1b9c01299142bc75135b337923cfa10e79bbbd669f00" dependencies = [ "async-channel", - "async-io 2.4.1", - "async-lock 3.4.0", + "async-io 2.5.0", + "async-lock 3.4.1", "async-signal", "async-task", "blocking", "cfg-if", - "event-listener 5.4.0", - "futures-lite 2.6.0", - "rustix 1.0.7", - "tracing", + "event-listener 5.4.1", + "futures-lite 2.6.1", + "rustix 1.0.8", ] [[package]] @@ -430,20 +428,20 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7605a4e50d4b06df3898d5a70bf5fde51ed9059b0434b73105193bc27acce0d" +checksum = "f567af260ef69e1d52c2b560ce0ea230763e6fbb9214a85d768760a920e3e3c1" dependencies = [ - "async-io 2.4.1", - "async-lock 3.4.0", + "async-io 2.5.0", + "async-lock 3.4.1", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 1.0.7", + "rustix 1.0.8", "signal-hook-registry", "slab", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -590,7 +588,7 @@ dependencies = [ "bitflags 2.9.1", "cexpr", "clang-sys", - "itertools", + "itertools 0.12.1", "lazy_static", "lazycell", "proc-macro2", @@ -666,14 +664,14 @@ dependencies = [ [[package]] name = "blocking" -version = "1.6.1" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" dependencies = [ "async-channel", "async-task", "futures-io", - "futures-lite 2.6.0", + "futures-lite 2.6.1", "piper", ] @@ -700,9 +698,9 @@ dependencies = [ [[package]] name = "bytemuck_derive" -version = "1.9.3" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ecc273b49b3205b83d648f0690daa588925572cc5063745bfe547fe7ec8e1a1" +checksum = "441473f2b4b0459a68628c744bc61d23e730fb00128b841d30fa4bb3972257e4" dependencies = [ "proc-macro2", "quote", @@ -745,7 +743,7 @@ checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" dependencies = [ "bitflags 2.9.1", "log", - "polling 3.8.0", + "polling 3.10.0", "rustix 0.38.44", "slab", "thiserror 1.0.69", @@ -753,13 +751,13 @@ dependencies = [ [[package]] name = "calloop" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10929724661d1c43856fd87c7a127ae944ec55579134fb485e4136fb6a46fdcb" +checksum = "cb9f6e1368bd4621d2c86baa7e37de77a938adf5221e5dd3d6133340101b309e" dependencies = [ "bitflags 2.9.1", - "polling 3.8.0", - "rustix 0.38.44", + "polling 3.10.0", + "rustix 1.0.8", "slab", "tracing", ] @@ -778,9 +776,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.27" +version = "1.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +checksum = "c3a42d84bb6b69d3a8b3eaacf0d88f179e1929695e1ad012b6cf64d9caaa5fd2" dependencies = [ "jobserver", "libc", @@ -838,23 +836,12 @@ dependencies = [ [[package]] name = "chrono-tz" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efdce149c370f133a071ca8ef6ea340b7b88748ab0810097a9e2976eaa34b4f3" +checksum = "a6139a8597ed92cf816dfb33f5dd6cf0bb93a6adc938f11039f371bc5bcd26c3" dependencies = [ "chrono", - "chrono-tz-build", - "phf", -] - -[[package]] -name = "chrono-tz-build" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f10f8c9340e31fc120ff885fcdb54a0b48e474bbd77cab557f0c30a3e569402" -dependencies = [ - "parse-zoneinfo", - "phf_codegen", + "phf 0.12.1", ] [[package]] @@ -875,9 +862,9 @@ checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "clipboard-win" -version = "5.4.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +checksum = "bde03770d3df201d4fb868f2c9c59e66a3e4e2bd06692a0fe701e7103c7e84d4" dependencies = [ "error-code", ] @@ -1068,7 +1055,7 @@ dependencies = [ [[package]] name = "cosmic-applets-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-applets#6c7a9bb989f86e14ae7d8d0f8d134759e6841b10" +source = "git+https://github.com/pop-os/cosmic-applets#a5d813dc9ba941b76a4898cfd4cdb133b9fd429b" dependencies = [ "cosmic-config", "serde", @@ -1093,7 +1080,7 @@ name = "cosmic-client-toolkit" version = "0.1.0" source = "git+https://github.com/pop-os/cosmic-protocols?rev=178eb0b#178eb0b14a0e5c192f64f6dee6c40341a8e5ee51" dependencies = [ - "cosmic-protocols", + "cosmic-protocols 0.1.0 (git+https://github.com/pop-os/cosmic-protocols?rev=178eb0b)", "libc", "smithay-client-toolkit", "wayland-client", @@ -1103,7 +1090,7 @@ dependencies = [ [[package]] name = "cosmic-comp-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-comp#17d6edb6d521563f21b3ed1d6911f1a073a71808" +source = "git+https://github.com/pop-os/cosmic-comp#38fe84abcf4f26aab40b06d2b901d4ee8ba83dcb" dependencies = [ "cosmic-config", "input", @@ -1113,10 +1100,10 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "atomicwrites", - "calloop 0.14.2", + "calloop 0.14.3", "cosmic-config-derive", "cosmic-settings-daemon", "dirs 6.0.0", @@ -1130,18 +1117,26 @@ dependencies = [ "tokio", "tracing", "xdg", - "zbus 5.7.1", + "zbus 5.9.0", ] [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "quote", "syn 2.0.104", ] +[[package]] +name = "cosmic-dbus-a11y" +version = "0.1.0" +source = "git+https://github.com/pop-os/dbus-settings-bindings#3b86984332be2c930a3536ab714b843c851fa8ca" +dependencies = [ + "zbus 5.9.0", +] + [[package]] name = "cosmic-dbus-networkmanager" version = "0.1.0" @@ -1152,8 +1147,8 @@ dependencies = [ "procfs", "thiserror 1.0.69", "time", - "zbus 5.7.1", - "zvariant 5.5.3", + "zbus 5.9.0", + "zvariant 5.6.0", ] [[package]] @@ -1163,7 +1158,7 @@ source = "git+https://github.com/pop-os/freedesktop-icons#8a05c322c482ff3c69cf34 dependencies = [ "dirs 5.0.1", "ini_core", - "memmap2 0.9.5", + "memmap2 0.9.7", "thiserror 2.0.12", "tracing", "xdg", @@ -1180,11 +1175,15 @@ dependencies = [ "clap_lex", "cosmic-applets-config", "cosmic-bg-config", + "cosmic-client-toolkit", "cosmic-comp-config", "cosmic-config", "cosmic-dbus-networkmanager", "cosmic-greeter-config", "cosmic-greeter-daemon", + "cosmic-protocols 0.1.0 (git+https://github.com/pop-os/cosmic-protocols?rev=1425bd4)", + "cosmic-settings-daemon-config", + "cosmic-settings-subscriptions", "dirs 6.0.0", "env_logger", "freedesktop_entry_parser", @@ -1209,7 +1208,7 @@ dependencies = [ "wayland-client", "xdg", "xkb-data", - "zbus 5.7.1", + "zbus 5.9.0", ] [[package]] @@ -1238,7 +1237,20 @@ dependencies = [ "ron 0.10.1", "serde", "tokio", - "zbus 5.7.1", + "zbus 5.9.0", +] + +[[package]] +name = "cosmic-protocols" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=1425bd4#1425bd44ed2b318a552201cc752ae11f2f483ef5" +dependencies = [ + "bitflags 2.9.1", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", ] [[package]] @@ -1255,10 +1267,24 @@ dependencies = [ "wayland-server", ] +[[package]] +name = "cosmic-protocols" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-protocols#5035f8c810bf734401e21e0a9625c7b7e0c73325" +dependencies = [ + "bitflags 2.9.1", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", + "wayland-server", +] + [[package]] name = "cosmic-settings-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-settings-daemon#f4f4fb39fb000bf8458404fe1629fb07cfd07235" +source = "git+https://github.com/pop-os/cosmic-settings-daemon#151780eee4262a08ff3abf63d8d7d1c69b575dc0" dependencies = [ "cosmic-config", "ron 0.9.0", @@ -1274,13 +1300,45 @@ name = "cosmic-settings-daemon" version = "0.1.0" source = "git+https://github.com/pop-os/dbus-settings-bindings#3b86984332be2c930a3536ab714b843c851fa8ca" dependencies = [ - "zbus 5.7.1", + "zbus 5.9.0", +] + +[[package]] +name = "cosmic-settings-daemon-config" +version = "0.1.0" +dependencies = [ + "cosmic-config", + "ron 0.8.1", + "serde", +] + +[[package]] +name = "cosmic-settings-subscriptions" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-settings-subscriptions#deafa8c6f9d349d54bc2ec0da702f896ab44e2e3" +dependencies = [ + "async-fn-stream", + "cosmic-dbus-a11y", + "cosmic-protocols 0.1.0 (git+https://github.com/pop-os/cosmic-protocols)", + "futures", + "iced_futures", + "itertools 0.14.0", + "libcosmic", + "log", + "num-derive", + "num-traits", + "smithay-client-toolkit", + "thiserror 2.0.12", + "tokio", + "tokio-stream", + "tracing", + "zbus 5.9.0", ] [[package]] name = "cosmic-text" version = "0.14.2" -source = "git+https://github.com/pop-os/cosmic-text.git#7646989d6f5b0d2bfe32a123e10fe13693d7c89c" +source = "git+https://github.com/pop-os/cosmic-text.git#de355a1fd9855e78273d4b7f2b5716eaaa38484f" dependencies = [ "bitflags 2.9.1", "fontdb 0.23.0", @@ -1302,7 +1360,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "almost", "cosmic-config", @@ -1327,9 +1385,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] @@ -1368,7 +1426,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb2a7d3066da2de787b7f032c736763eb7ae5d355f81a68bab2675a96008b0bf" dependencies = [ - "phf", + "phf 0.11.3", ] [[package]] @@ -1377,7 +1435,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fda6aace1fbef3aa217b27f4c8d7d071ef2a70a5ca51050b1f17d40299d3f16" dependencies = [ - "phf", + "phf 0.11.3", "serde", ] @@ -1512,9 +1570,9 @@ dependencies = [ [[package]] name = "derive_setters" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c848e86c87e5cc305313041c5677d4d95d60baa71cf95e5f6ea2554bb629ff" +checksum = "ae5c625eda104c228c06ecaf988d1c60e542176bd7a490e60eeda3493244c0c9" dependencies = [ "darling", "proc-macro2", @@ -1581,7 +1639,7 @@ checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" dependencies = [ "libc", "option-ext", - "redox_users 0.5.0", + "redox_users 0.5.2", "windows-sys 0.60.2", ] @@ -1591,18 +1649,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" -[[package]] -name = "dispatch2" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a0d569e003ff27784e0e14e4a594048698e0c0f0b66cabcb51511be55a7caa0" -dependencies = [ - "bitflags 2.9.1", - "block2 0.6.1", - "libc", - "objc2 0.6.1", -] - [[package]] name = "dispatch2" version = "0.3.0" @@ -1610,6 +1656,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" dependencies = [ "bitflags 2.9.1", + "block2 0.6.1", + "libc", "objc2 0.6.1", ] @@ -1706,9 +1754,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "either" @@ -1827,9 +1875,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.4.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" dependencies = [ "concurrent-queue", "parking", @@ -1842,7 +1890,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.4.0", + "event-listener 5.4.1", "pin-project-lite", ] @@ -1876,18 +1924,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "filetime" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys 0.59.0", -] - [[package]] name = "find-crate" version = "0.6.3" @@ -2012,7 +2048,7 @@ checksum = "e32eac81c1135c1df01d4e6d4233c47ba11f6a6d07f33e0bba09d18797077770" dependencies = [ "fontconfig-parser", "log", - "memmap2 0.9.5", + "memmap2 0.9.7", "slotmap", "tinyvec", "ttf-parser 0.21.1", @@ -2026,7 +2062,7 @@ checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905" dependencies = [ "fontconfig-parser", "log", - "memmap2 0.9.5", + "memmap2 0.9.7", "slotmap", "tinyvec", "ttf-parser 0.25.1", @@ -2167,9 +2203,9 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" dependencies = [ "fastrand 2.3.0", "futures-core", @@ -2507,9 +2543,9 @@ checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" [[package]] name = "i18n-config" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e88074831c0be5b89181b05e6748c4915f77769ecc9a4c372f88b169a8509c9" +checksum = "3e06b90c8a0d252e203c94344b21e35a30f3a3a85dc7db5af8f8df9f3e0c63ef" dependencies = [ "basic-toml", "log", @@ -2602,7 +2638,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "dnd", "iced_accessibility", @@ -2620,7 +2656,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "accesskit", "accesskit_winit", @@ -2629,13 +2665,14 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "bitflags 2.9.1", "bytes", "cosmic-client-toolkit", "dnd", "glam", + "iced_accessibility", "log", "mime 0.1.0", "num-traits", @@ -2653,7 +2690,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "futures", "iced_core", @@ -2679,7 +2716,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "bitflags 2.9.1", "bytemuck", @@ -2701,7 +2738,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2713,11 +2750,12 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "bytes", "cosmic-client-toolkit", "dnd", + "iced_accessibility", "iced_core", "iced_futures", "raw-window-handle", @@ -2728,7 +2766,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "bytemuck", "cosmic-text", @@ -2744,7 +2782,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "as-raw-xcb-connection", "bitflags 2.9.1", @@ -2775,10 +2813,11 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "cosmic-client-toolkit", "dnd", + "iced_accessibility", "iced_renderer", "iced_runtime", "log", @@ -2794,10 +2833,11 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "cosmic-client-toolkit", "dnd", + "iced_accessibility", "iced_futures", "iced_graphics", "iced_runtime", @@ -2936,7 +2976,7 @@ dependencies = [ "potential_utf", "yoke 0.8.0", "zerofrom", - "zerovec 0.11.2", + "zerovec 0.11.4", ] [[package]] @@ -3055,7 +3095,7 @@ dependencies = [ "litemap 0.8.0", "tinystr 0.8.1", "writeable 0.6.1", - "zerovec 0.11.2", + "zerovec 0.11.4", ] [[package]] @@ -3121,7 +3161,7 @@ dependencies = [ "icu_properties 2.0.1", "icu_provider 2.0.0", "smallvec", - "zerovec 0.11.2", + "zerovec 0.11.4", ] [[package]] @@ -3197,7 +3237,7 @@ dependencies = [ "icu_provider 2.0.0", "potential_utf", "zerotrie 0.2.2", - "zerovec 0.11.2", + "zerovec 0.11.4", ] [[package]] @@ -3243,7 +3283,7 @@ dependencies = [ "yoke 0.8.0", "zerofrom", "zerotrie 0.2.2", - "zerovec 0.11.2", + "zerovec 0.11.4", ] [[package]] @@ -3369,9 +3409,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown 0.15.4", @@ -3465,6 +3505,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "io-uring" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "libc", +] + [[package]] name = "is-terminal" version = "0.4.16" @@ -3485,6 +3536,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.15" @@ -3567,11 +3627,11 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "known-folders" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7d9a1740cc8b46e259a0eb787d79d855e79ff10b9855a5eba58868d5da7927c" +checksum = "c644f4623d1c55eb60a9dac35e0858a59f982fb87db6ce34c872372b0a5b728f" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -3606,11 +3666,12 @@ dependencies = [ [[package]] name = "kurbo" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1077d333efea6170d9ccb96d3c3026f300ca0773da4938cc4c811daa6df68b0c" +checksum = "c62026ae44756f8a599ba21140f350303d4f08dcdcc71b5ad9c9bb8128c13c62" dependencies = [ "arrayvec", + "euclid", "smallvec", ] @@ -3635,7 +3696,7 @@ checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#05874e8ea252be0e6115c268aef18a19019842f4" +source = "git+https://github.com/pop-os/libcosmic#562e88587207368969e7bcd43bce3ccf81aee8d9" dependencies = [ "apply", "ashpd", @@ -3652,6 +3713,7 @@ dependencies = [ "freedesktop-desktop-entry", "futures", "iced", + "iced_accessibility", "iced_core", "iced_futures", "iced_renderer", @@ -3666,7 +3728,7 @@ dependencies = [ "palette", "raw-window-handle", "rfd", - "rustix 1.0.7", + "rustix 1.0.8", "serde", "shlex", "slotmap", @@ -3676,7 +3738,7 @@ dependencies = [ "tracing", "unicode-segmentation", "url", - "zbus 5.7.1", + "zbus 5.9.0", ] [[package]] @@ -3686,7 +3748,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.53.2", + "windows-targets 0.53.3", ] [[package]] @@ -3697,13 +3759,13 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libredox" -version = "0.1.4" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" +checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" dependencies = [ "bitflags 2.9.1", "libc", - "redox_syscall 0.5.13", + "redox_syscall 0.5.17", ] [[package]] @@ -3754,9 +3816,9 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "litrs" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +checksum = "f5e54036fe321fd421e10d732f155734c4e4afd610dd556d9a82833ab3ee0bed" [[package]] name = "locale_config" @@ -3794,7 +3856,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469c962578b549a82f3d0cc72d0f77d1123780fa7121e2b03d78b0780f6ccac6" dependencies = [ "serde", - "zbus 5.7.1", + "zbus 5.9.0", ] [[package]] @@ -3881,9 +3943,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.5" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +checksum = "483758ad303d734cec05e5c12b41d7e93e6a6390c5e9dae6bdeb7c1259012d28" dependencies = [ "libc", ] @@ -3981,7 +4043,7 @@ dependencies = [ "cfg_aliases 0.1.1", "codespan-reporting", "hexf-parse", - "indexmap 2.9.0", + "indexmap 2.10.0", "log", "rustc-hash 1.1.0", "spirv", @@ -4078,12 +4140,11 @@ dependencies = [ [[package]] name = "notify" -version = "8.0.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" +checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" dependencies = [ "bitflags 2.9.1", - "filetime", "fsevent-sys", "inotify", "kqueue", @@ -4092,7 +4153,7 @@ dependencies = [ "mio", "notify-types", "walkdir", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -4117,6 +4178,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "num-integer" version = "0.1.46" @@ -4304,7 +4376,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166" dependencies = [ "bitflags 2.9.1", - "dispatch2 0.3.0", + "dispatch2", "objc2 0.6.1", ] @@ -4529,9 +4601,9 @@ dependencies = [ [[package]] name = "owned_ttf_parser" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec719bbf3b2a81c109a4e20b1f129b5566b7dce654bc3872f6a05abf82b2c4" +checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" dependencies = [ "ttf-parser 0.25.1", ] @@ -4545,7 +4617,7 @@ dependencies = [ "approx", "fast-srgb8", "palette_derive", - "phf", + "phf 0.11.3", "serde", ] @@ -4634,20 +4706,11 @@ checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.13", + "redox_syscall 0.5.17", "smallvec", "windows-targets 0.52.6", ] -[[package]] -name = "parse-zoneinfo" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" -dependencies = [ - "regex", -] - [[package]] name = "paste" version = "1.0.15" @@ -4667,17 +4730,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", - "phf_shared", + "phf_shared 0.11.3", ] [[package]] -name = "phf_codegen" -version = "0.11.3" +name = "phf" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7" dependencies = [ - "phf_generator", - "phf_shared", + "phf_shared 0.12.1", ] [[package]] @@ -4686,7 +4748,7 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ - "phf_shared", + "phf_shared 0.11.3", "rand 0.8.5", ] @@ -4697,7 +4759,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", - "phf_shared", + "phf_shared 0.11.3", "proc-macro2", "quote", "syn 2.0.104", @@ -4712,6 +4774,15 @@ dependencies = [ "siphasher", ] +[[package]] +name = "phf_shared" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981" +dependencies = [ + "siphasher", +] + [[package]] name = "pico-args" version = "0.5.0" @@ -4798,17 +4869,16 @@ dependencies = [ [[package]] name = "polling" -version = "3.8.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b53a684391ad002dd6a596ceb6c74fd004fdce75f4be2e3f615068abbea5fd50" +checksum = "b5bd19146350fe804f7cb2669c851c03d69da628803dab0d98018142aaa5d829" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi 0.5.2", "pin-project-lite", - "rustix 1.0.7", - "tracing", - "windows-sys 0.59.0", + "rustix 1.0.8", + "windows-sys 0.60.2", ] [[package]] @@ -4823,7 +4893,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" dependencies = [ - "zerovec 0.11.2", + "zerovec 0.11.4", ] [[package]] @@ -4993,9 +5063,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", @@ -5047,9 +5117,9 @@ checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde" [[package]] name = "rangemap" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" +checksum = "f93e7e49bb0bf967717f7bd674458b3d6b0c5f48ec7e3038166026a69fc22223" [[package]] name = "raw-window-handle" @@ -5087,9 +5157,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.13" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" dependencies = [ "bitflags 2.9.1", ] @@ -5107,9 +5177,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ "getrandom 0.2.16", "libredox", @@ -5198,13 +5268,13 @@ dependencies = [ [[package]] name = "rfd" -version = "0.15.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80c844748fdc82aae252ee4594a89b6e7ebef1063de7951545564cbc4e57075d" +checksum = "ef2bee61e6cffa4635c72d7d81a84294e28f0930db0ddcb0f66d10244674ebed" dependencies = [ "ashpd", "block2 0.6.1", - "dispatch2 0.2.0", + "dispatch2", "js-sys", "log", "objc2 0.6.1", @@ -5222,9 +5292,9 @@ dependencies = [ [[package]] name = "rgb" -version = "0.8.50" +version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" +checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce" dependencies = [ "bytemuck", ] @@ -5321,9 +5391,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustc-hash" @@ -5366,15 +5436,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ "bitflags 2.9.1", "errno", "libc", "linux-raw-sys 0.9.4", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -5427,6 +5497,18 @@ dependencies = [ "serde_json", ] +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -5447,7 +5529,7 @@ checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" dependencies = [ "ab_glyph", "log", - "memmap2 0.9.5", + "memmap2 0.9.7", "smithay-client-toolkit", "tiny-skia", ] @@ -5501,11 +5583,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" dependencies = [ - "indexmap 2.9.0", + "indexmap 2.10.0", "itoa", "memchr", "ryu", @@ -5525,16 +5607,17 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf65a400f8f66fb7b0552869ad70157166676db75ed8181f8104ea91cf9d0b42" +checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.9.0", - "schemars", + "indexmap 2.10.0", + "schemars 0.9.0", + "schemars 1.0.4", "serde", "serde_derive", "serde_json", @@ -5544,9 +5627,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81679d9ed988d5e9a5e6531dc3f2c28efbd639cbd1dfb628df08edea6004da77" +checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" dependencies = [ "darling", "proc-macro2", @@ -5584,9 +5667,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.5" +version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" dependencies = [ "libc", ] @@ -5656,7 +5739,7 @@ dependencies = [ "cursor-icon", "libc", "log", - "memmap2 0.9.5", + "memmap2 0.9.7", "pkg-config", "rustix 0.38.44", "thiserror 1.0.69", @@ -5703,12 +5786,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.10" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5726,7 +5809,7 @@ dependencies = [ "foreign-types", "js-sys", "log", - "memmap2 0.9.5", + "memmap2 0.9.7", "objc", "raw-window-handle", "redox_syscall 0.4.1", @@ -5795,7 +5878,7 @@ version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc" dependencies = [ - "kurbo 0.11.2", + "kurbo 0.11.3", "siphasher", ] @@ -5878,7 +5961,7 @@ dependencies = [ "fastrand 2.3.0", "getrandom 0.3.3", "once_cell", - "rustix 1.0.7", + "rustix 1.0.8", "windows-sys 0.59.0", ] @@ -5969,7 +6052,7 @@ name = "timedate-zbus" version = "0.1.0" source = "git+https://github.com/pop-os/dbus-settings-bindings#3b86984332be2c930a3536ab714b843c851fa8ca" dependencies = [ - "zbus 5.7.1", + "zbus 5.9.0", ] [[package]] @@ -6028,7 +6111,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", - "zerovec 0.11.2", + "zerovec 0.11.4", ] [[package]] @@ -6048,21 +6131,23 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.45.1" +version = "1.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" dependencies = [ "backtrace", "bytes", + "io-uring", "libc", "mio", "parking_lot 0.12.4", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.10", + "slab", + "socket2 0.6.0", "tokio-macros", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6108,7 +6193,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.9.0", + "indexmap 2.10.0", "toml_datetime", "winnow 0.5.40", ] @@ -6119,9 +6204,9 @@ version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.9.0", + "indexmap 2.10.0", "toml_datetime", - "winnow 0.7.11", + "winnow 0.7.12", ] [[package]] @@ -6307,7 +6392,7 @@ source = "git+https://github.com/pop-os/dbus-settings-bindings#3b86984332be2c930 dependencies = [ "serde", "serde_repr", - "zbus 5.7.1", + "zbus 5.9.0", ] [[package]] @@ -6339,7 +6424,7 @@ dependencies = [ "flate2", "fontdb 0.18.0", "imagesize", - "kurbo 0.11.2", + "kurbo 0.11.3", "log", "pico-args", "roxmltree", @@ -6504,13 +6589,13 @@ dependencies = [ [[package]] name = "wayland-backend" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe770181423e5fc79d3e2a7f4410b7799d5aab1de4372853de3c6aa13ca24121" +checksum = "673a33c33048a5ade91a6b139580fa174e19fb0d23f396dca9fa15f2e1e49b35" dependencies = [ "cc", "downcast-rs", - "rustix 0.38.44", + "rustix 1.0.8", "scoped-tls", "smallvec", "wayland-sys", @@ -6518,12 +6603,12 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.10" +version = "0.31.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978fa7c67b0847dbd6a9f350ca2569174974cd4082737054dbb7fbb79d7d9a61" +checksum = "c66a47e840dc20793f2264eb4b3e4ecb4b75d91c0dd4af04b456128e0bdd449d" dependencies = [ "bitflags 2.9.1", - "rustix 0.38.44", + "rustix 1.0.8", "wayland-backend", "wayland-scanner", ] @@ -6541,20 +6626,20 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.31.10" +version = "0.31.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a65317158dec28d00416cb16705934070aef4f8393353d41126c54264ae0f182" +checksum = "447ccc440a881271b19e9989f75726d60faa09b95b0200a9b7eb5cc47c3eeb29" dependencies = [ - "rustix 0.38.44", + "rustix 1.0.8", "wayland-client", "xcursor", ] [[package]] name = "wayland-protocols" -version = "0.32.8" +version = "0.32.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "779075454e1e9a521794fed15886323ea0feda3f8b0fc1390f5398141310422a" +checksum = "efa790ed75fbfd71283bd2521a1cfdc022aabcc28bdcff00851f9e4ae88d9901" dependencies = [ "bitflags 2.9.1", "wayland-backend", @@ -6565,9 +6650,9 @@ dependencies = [ [[package]] name = "wayland-protocols-plasma" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fd38cdad69b56ace413c6bcc1fbf5acc5e2ef4af9d5f8f1f9570c0c83eae175" +checksum = "a07a14257c077ab3279987c4f8bb987851bf57081b93710381daea94f2c2c032" dependencies = [ "bitflags 2.9.1", "wayland-backend", @@ -6578,9 +6663,9 @@ dependencies = [ [[package]] name = "wayland-protocols-wlr" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cb6cdc73399c0e06504c437fe3cf886f25568dd5454473d565085b36d6a8bbf" +checksum = "efd94963ed43cf9938a090ca4f7da58eb55325ec8200c3848963e98dc25b78ec" dependencies = [ "bitflags 2.9.1", "wayland-backend", @@ -6592,9 +6677,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.6" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484" +checksum = "54cb1e9dc49da91950bdfd8b848c49330536d9d1fb03d4bfec8cae50caa50ae3" dependencies = [ "proc-macro2", "quick-xml", @@ -6603,22 +6688,22 @@ dependencies = [ [[package]] name = "wayland-server" -version = "0.31.9" +version = "0.31.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "485dfb8ccf0daa0d34625d34e6ac15f99e550a7999b6fd88a0835ccd37655785" +checksum = "fcbd4f3aba6c9fba70445ad2a484c0ef0356c1a9459b1e8e435bedc1971a6222" dependencies = [ "bitflags 2.9.1", "downcast-rs", - "rustix 0.38.44", + "rustix 1.0.8", "wayland-backend", "wayland-scanner", ] [[package]] name = "wayland-sys" -version = "0.31.6" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615" +checksum = "34949b42822155826b41db8e5d0c1be3a2bd296c747577a43a3e6daefc296142" dependencies = [ "dlib", "log", @@ -6688,7 +6773,7 @@ dependencies = [ "bitflags 2.9.1", "cfg_aliases 0.1.1", "document-features", - "indexmap 2.9.0", + "indexmap 2.10.0", "log", "naga", "once_cell", @@ -6983,7 +7068,7 @@ version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.53.2", + "windows-targets 0.53.3", ] [[package]] @@ -7034,10 +7119,11 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.2" +version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ + "windows-link", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", @@ -7248,7 +7334,7 @@ dependencies = [ "dpi", "js-sys", "libc", - "memmap2 0.9.5", + "memmap2 0.9.7", "ndk", "objc2 0.5.2", "objc2-app-kit 0.2.2", @@ -7290,9 +7376,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" +checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" dependencies = [ "memchr", ] @@ -7426,9 +7512,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.26" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" +checksum = "6fd8403733700263c6eb89f192880191f1b83e332f7a20371ddcf421c4a337c7" [[package]] name = "xmlwriter" @@ -7534,23 +7620,23 @@ dependencies = [ [[package]] name = "zbus" -version = "5.7.1" +version = "5.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a7c7cee313d044fca3f48fa782cb750c79e4ca76ba7bc7718cd4024cdf6f68" +checksum = "4bb4f9a464286d42851d18a605f7193b8febaf5b0919d71c6399b7b26e5b0aad" dependencies = [ "async-broadcast 0.7.2", "async-executor", - "async-io 2.4.1", - "async-lock 3.4.0", - "async-process 2.3.1", + "async-io 2.5.0", + "async-lock 3.4.1", + "async-process 2.4.0", "async-recursion", "async-task", "async-trait", "blocking", "enumflags2", - "event-listener 5.4.0", + "event-listener 5.4.1", "futures-core", - "futures-lite 2.6.0", + "futures-lite 2.6.1", "hex", "nix 0.30.1", "ordered-stream", @@ -7560,10 +7646,10 @@ dependencies = [ "tracing", "uds_windows", "windows-sys 0.59.0", - "winnow 0.7.11", - "zbus_macros 5.7.1", + "winnow 0.7.12", + "zbus_macros 5.9.0", "zbus_names 4.2.0", - "zvariant 5.5.3", + "zvariant 5.6.0", ] [[package]] @@ -7582,16 +7668,16 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "5.7.1" +version = "5.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17e7e5eec1550f747e71a058df81a9a83813ba0f6a95f39c4e218bdc7ba366a" +checksum = "ef9859f68ee0c4ee2e8cde84737c78e3f4c54f946f2a38645d0d4c7a95327659" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", "quote", "syn 2.0.104", "zbus_names 4.2.0", - "zvariant 5.5.3", + "zvariant 5.6.0", "zvariant_utils 3.2.0", ] @@ -7614,8 +7700,8 @@ checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" dependencies = [ "serde", "static_assertions", - "winnow 0.7.11", - "zvariant 5.5.3", + "winnow 0.7.12", + "zvariant 5.6.0", ] [[package]] @@ -7700,9 +7786,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.2" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" dependencies = [ "yoke 0.8.0", "zerofrom", @@ -7739,9 +7825,9 @@ checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" [[package]] name = "zune-jpeg" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7384255a918371b5af158218d131530f694de9ad3815ebdd0453a940485cb0fa" +checksum = "fc1f7e205ce79eb2da3cd71c5f55f3589785cb7c79f6a03d1c8d1491bda5d089" dependencies = [ "zune-core", ] @@ -7762,16 +7848,16 @@ dependencies = [ [[package]] name = "zvariant" -version = "5.5.3" +version = "5.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d30786f75e393ee63a21de4f9074d4c038d52c5b1bb4471f955db249f9dffb1" +checksum = "d91b3680bb339216abd84714172b5138a4edac677e641ef17e1d8cb1b3ca6e6f" dependencies = [ "endi", "enumflags2", "serde", "url", - "winnow 0.7.11", - "zvariant_derive 5.5.3", + "winnow 0.7.12", + "zvariant_derive 5.6.0", "zvariant_utils 3.2.0", ] @@ -7790,9 +7876,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "5.5.3" +version = "5.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75fda702cd42d735ccd48117b1630432219c0e9616bf6cb0f8350844ee4d9580" +checksum = "3a8c68501be459a8dbfffbe5d792acdd23b4959940fc87785fb013b32edbc208" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -7823,5 +7909,5 @@ dependencies = [ "serde", "static_assertions", "syn 2.0.104", - "winnow 0.7.11", + "winnow 0.7.12", ] diff --git a/Cargo.toml b/Cargo.toml index 57fb97e..0840677 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,21 @@ xdg = "2.5.2" #TODO: reduce features tokio = { workspace = true, features = ["full"] } wayland-client = "0.31.8" +cosmic-settings-subscriptions = { git = "https://github.com/pop-os/cosmic-settings-subscriptions", default-features = false, features = [ + "accessibility", + "cosmic_a11y_manager", +] } +# cosmic-settings-daemon-config = { git = "https://github.com/pop-os/cosmic-settings-daemon", default-features = false, features = [ +# "greeter", +# ] } +cosmic-settings-daemon-config = { path = "../cosmic-settings-daemon/cosmic-settings-daemon-config", default-features = false, features = [ + "greeter", +] } +cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "178eb0b" } +cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", default-features = false, features = [ + "client", +], rev = "1425bd4" } + # For network status using networkmanager feature cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } # For logind integration using logind feature @@ -131,7 +146,9 @@ default-features = false git = "https://github.com/pop-os/libcosmic" default-features = false -# [patch.'https://github.com/pop-os/libcosmic'] + +[patch."https://github.com/smithay/client-toolkit.git"] +sctk = { package = "smithay-client-toolkit", version = "=0.19.2" } # libcosmic = { path = "../libcosmic" } # cosmic-config = { path = "../libcosmic/cosmic-config" } # cosmic-theme = { path = "../libcosmic/cosmic-theme" } diff --git a/i18n/en/cosmic_greeter.ftl b/i18n/en/cosmic_greeter.ftl index 1552ab3..122fe04 100644 --- a/i18n/en/cosmic_greeter.ftl +++ b/i18n/en/cosmic_greeter.ftl @@ -1,3 +1,8 @@ +accessibility = Accessibility + .screen-reader = Screen Reader + .magnifier = Magnifier + .high-contrast = High contrast + .invert-colors = Invert Colors cancel = Cancel caps-lock = Caps Lock is active. enter-user = Enter name manually... diff --git a/src/greeter.rs b/src/greeter.rs index 1a019f7..b91e48b 100644 --- a/src/greeter.rs +++ b/src/greeter.rs @@ -3,6 +3,8 @@ mod ipc; +use crate::wayland::{self, WaylandUpdate}; +use cctk::sctk::reexports::calloop; use cosmic::app::{Core, Settings, Task}; use cosmic::cctk::wayland_protocols::xdg::shell::client::xdg_positioner::Gravity; use cosmic::iced::{Point, Size}; @@ -29,6 +31,10 @@ use cosmic::{ }; use cosmic_greeter_config::Config as CosmicGreeterConfig; use cosmic_greeter_daemon::UserData; +use cosmic_settings_subscriptions::{ + accessibility::{self, DBusRequest, DBusUpdate}, + cosmic_a11y_manager::{AccessibilityEvent, AccessibilityRequest, ColorFilter}, +}; use greetd_ipc::Request; use std::sync::LazyLock; use std::{ @@ -41,7 +47,7 @@ use std::{ sync::Arc, time::{Duration, Instant}, }; -use tokio::time; +use tokio::{sync::mpsc::UnboundedSender, time}; use wayland_client::{Proxy, protocol::wl_output::WlOutput}; use zbus::{Connection, proxy}; @@ -316,6 +322,7 @@ impl DialogPage { ///TODO: this is custom code that should be better handled by libcosmic #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Dropdown { + Accessibility, Keyboard, User, Session, @@ -332,6 +339,7 @@ struct NameIndexPair { #[derive(Clone, Debug)] pub enum Message { Common(common::Message), + DBusUpdate(DBusUpdate), OutputEvent(OutputEvent, WlOutput), Auth(Option), ConfigUpdateUser, @@ -354,6 +362,11 @@ pub enum Message { Suspend, Username(String), EnterUser(bool, String), + ScreenReader(bool), + Magnifier(bool), + HighContrast(bool), + InvertColors(bool), + WaylandUpdate(WaylandUpdate), } impl From for Message { @@ -376,6 +389,23 @@ pub struct App { dropdown_opt: Option, heartbeat_handle: Option, entering_name: bool, + + accessibility: Accessibility, +} + +#[derive(Default)] +struct Accessibility { + pub dbus_sender: Option>, + pub wayland_sender: Option>, + pub wayland_protocol_version: Option, + + pub state: cosmic_settings_daemon_config::greeter::GreeterAccessibilityState, + pub helper: Option, + + pub screen_reader: bool, + pub magnifier: bool, + pub high_contrast: bool, + pub invert_colors: bool, } impl App { @@ -414,7 +444,11 @@ impl App { } //TODO: move code for custom dropdowns to libcosmic - let menu_checklist = |label, value, message| { + fn menu_checklist<'a>( + label: impl Into> + 'a, + value: bool, + message: Message, + ) -> Element<'a, Message> { Element::from( widget::menu::menu_button(vec![ if value { @@ -433,7 +467,7 @@ impl App { ]) .on_press(message), ) - }; + } let dropdown_menu = |items: Vec<_>| { let item_cnt = items.len(); @@ -544,14 +578,49 @@ impl App { session_button = session_button.popup(dropdown_menu(items)); } - let button_row = iced::widget::row![ - /*TODO: greeter accessibility options - widget::button(widget::icon::from_name( - "applications-accessibility-symbolic" + // Accessibility menu as a popup dialog + let mut accessibility_dropdown = widget::popover( + widget::button::custom(widget::icon::from_name( + "applications-accessibility-symbolic", )) .padding(12.0) - .on_press(Message::None), - */ + .on_press(Message::DropdownToggle(Dropdown::Accessibility)), // We'll use Dropdown::Keyboard as a dummy, since we don't have a dedicated Dropdown for accessibility + ) + .position(widget::popover::Position::Bottom); + + if matches!(self.dropdown_opt, Some(Dropdown::Accessibility)) { + let mut items = Vec::new(); + items.push(menu_checklist( + fl!("accessibility", "screen-reader"), + self.accessibility.screen_reader, + Message::ScreenReader(!self.accessibility.screen_reader), + )); + items.push(menu_checklist( + fl!("accessibility", "magnifier"), + self.accessibility.magnifier, + Message::Magnifier(!self.accessibility.magnifier), + )); + items.push(menu_checklist( + fl!("accessibility", "high-contrast"), + self.accessibility.high_contrast, + Message::HighContrast(!self.accessibility.high_contrast), + )); + items.push(menu_checklist( + fl!("accessibility", "invert-colors"), + self.accessibility.invert_colors, + Message::InvertColors(!self.accessibility.invert_colors), + )); + accessibility_dropdown = accessibility_dropdown.popup(dropdown_menu(items)); + } + + let accessibility_button = accessibility_dropdown; + + let button_row = iced::widget::row![ + widget::tooltip( + accessibility_button, + text(fl!("accessibility")), + widget::tooltip::Position::Top + ), widget::tooltip( input_button, text(fl!("keyboard-layout")), @@ -871,6 +940,10 @@ impl cosmic::Application for App { /// Creates the application, and optionally emits command on initialize. fn init(core: Core, flags: Self::Flags) -> (Self, Task) { + // init state that is communicated to cosmic session + if let Err(err) = crate::state::init() { + log::error!("{err:?}"); + } let (mut common, common_task) = Common::init(core); common.on_output_event = Some(Box::new(|output_event, output| { Message::OutputEvent(output_event, output) @@ -917,6 +990,9 @@ impl cosmic::Application for App { .unwrap_or_default(); let data_idx = Some(0); let selected_username = NameIndexPair { username, data_idx }; + let mut accessibility = Accessibility::default(); + accessibility.helper = + cosmic_settings_daemon_config::greeter::GreeterAccessibilityState::config().ok(); let app = App { common, @@ -931,6 +1007,7 @@ impl cosmic::Application for App { dropdown_opt: None, heartbeat_handle: None, entering_name: false, + accessibility, }; (app, common_task) } @@ -941,6 +1018,20 @@ impl cosmic::Application for App { Message::Common(common_message) => { return self.common.update(common_message); } + Message::DBusUpdate(update) => match update { + DBusUpdate::Error(err) => { + log::error!("{err}"); + let _ = self.accessibility.dbus_sender.take(); + self.accessibility.screen_reader = false; + } + DBusUpdate::Status(enabled) => { + self.accessibility.screen_reader = enabled; + } + DBusUpdate::Init(enabled, tx) => { + self.accessibility.screen_reader = enabled; + self.accessibility.dbus_sender = Some(tx); + } + }, Message::OutputEvent(output_event, output) => { match output_event { OutputEvent::Created(output_info_opt) => { @@ -1366,6 +1457,60 @@ impl cosmic::Application for App { cosmic::app::Action::Surface(a), )); } + Message::ScreenReader(enabled) => { + if let Some(tx) = &self.accessibility.dbus_sender.as_ref() { + self.accessibility.screen_reader = enabled; + let _ = tx.send(DBusRequest::Status(enabled)); + } else { + self.accessibility.screen_reader = false; + } + } + Message::Magnifier(enabled) => { + if let Some(tx) = &self.accessibility.wayland_sender { + self.accessibility.magnifier = enabled; + let _ = tx.send(AccessibilityRequest::Magnifier(enabled)); + } else { + self.accessibility.magnifier = false; + } + } + Message::HighContrast(enabled) => { + self.accessibility.high_contrast = enabled; + } + Message::InvertColors(enabled) => { + if let Some(tx) = &self.accessibility.wayland_sender { + self.accessibility.invert_colors = enabled; + let _ = tx.send(AccessibilityRequest::ScreenFilter { + inverted: enabled, + filter: None, + }); + } else { + self.accessibility.invert_colors = false; + } + } + Message::WaylandUpdate(update) => match update { + WaylandUpdate::Errored => { + let _ = self.accessibility.wayland_sender.take(); + self.accessibility.wayland_protocol_version = None; + self.accessibility.magnifier = false; + self.accessibility.invert_colors = false; + } + WaylandUpdate::State(AccessibilityEvent::Bound(ver)) => { + self.accessibility.wayland_protocol_version = Some(ver); + } + WaylandUpdate::State(AccessibilityEvent::Magnifier(enabled)) => { + self.accessibility.magnifier = enabled; + } + WaylandUpdate::State(AccessibilityEvent::ScreenFilter { inverted, .. }) => { + self.accessibility.invert_colors = inverted; + } + WaylandUpdate::State(AccessibilityEvent::Closed) => { + self.accessibility.wayland_sender = None; + self.accessibility.wayland_protocol_version = None; + } + WaylandUpdate::Started(tx) => { + self.accessibility.wayland_sender = Some(tx); + } + }, } Task::none() } @@ -1393,6 +1538,8 @@ impl cosmic::Application for App { Subscription::batch([ self.common.subscription().map(Message::from), ipc::subscription(), + wayland::a11y_subscription().map(Message::WaylandUpdate), + accessibility::subscription().map(Message::DBusUpdate), ]) } } diff --git a/src/lib.rs b/src/lib.rs index d709b49..34a8b5b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,8 @@ pub mod greeter; pub mod locker; +mod wayland; + mod common; mod localize; @@ -17,4 +19,6 @@ mod networkmanager; #[cfg(feature = "upower")] mod upower; +mod state; + mod time; diff --git a/src/state.rs b/src/state.rs new file mode 100644 index 0000000..3348acc --- /dev/null +++ b/src/state.rs @@ -0,0 +1,8 @@ +use std::os::unix::fs::PermissionsExt as _; + +pub fn init() -> anyhow::Result<()> { + let path = cosmic_settings_daemon_config::greeter::GreeterAccessibilityState::path(); + std::fs::create_dir_all(&path)?; + std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o755))?; + Ok(()) +} diff --git a/src/wayland/mod.rs b/src/wayland/mod.rs new file mode 100644 index 0000000..379c0e9 --- /dev/null +++ b/src/wayland/mod.rs @@ -0,0 +1,86 @@ +// Copyright 2023 System76 +// SPDX-License-Identifier: GPL-3.0-only + +use anyhow; +use cctk::sctk::reexports::calloop; +use cosmic::iced::{ + self, Subscription, + futures::{self, SinkExt}, + stream, +}; +use cosmic_settings_subscriptions::cosmic_a11y_manager::{ + self as thread, AccessibilityEvent, AccessibilityRequest, +}; +use std::sync::LazyLock; +use tokio::sync::Mutex; + +pub static WAYLAND_RX: LazyLock>>> = + LazyLock::new(|| Mutex::new(None)); + +#[derive(Debug, Clone)] +pub enum WaylandUpdate { + State(AccessibilityEvent), + Started(calloop::channel::Sender), + Errored, +} + +pub fn a11y_subscription() -> iced::Subscription { + Subscription::run_with_id( + std::any::TypeId::of::(), + stream::channel(50, move |mut output| async move { + let mut state = State::Waiting; + + loop { + state = start_listening(state, &mut output).await; + } + }), + ) +} + +async fn start_listening( + state: State, + output: &mut futures::channel::mpsc::Sender, +) -> State { + match state { + State::Waiting => { + let mut guard = WAYLAND_RX.lock().await; + let rx = { + if guard.is_none() { + if let Ok(WaylandWatcher { rx, tx }) = WaylandWatcher::new() { + *guard = Some(rx); + _ = output.send(WaylandUpdate::Started(tx)).await; + } else { + _ = output.send(WaylandUpdate::Errored).await; + return State::Error; + } + } + guard.as_mut().unwrap() + }; + if let Some(w) = rx.recv().await { + _ = output.send(WaylandUpdate::State(w)).await; + State::Waiting + } else { + _ = output.send(WaylandUpdate::Errored).await; + State::Error + } + } + State::Error => cosmic::iced::futures::future::pending().await, + } +} + +pub enum State { + Waiting, + Error, +} + +pub struct WaylandWatcher { + rx: tokio::sync::mpsc::Receiver, + tx: calloop::channel::Sender, +} + +impl WaylandWatcher { + pub fn new() -> anyhow::Result { + let (tx, rx) = thread::spawn_wayland_connection(1)?; + Ok(Self { tx, rx }) + } +}