diff --git a/Cargo.lock b/Cargo.lock index 26a3f58..37c09f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,17 +15,6 @@ dependencies = [ "accesskit", ] -[[package]] -name = "accesskit_macos" -version = "0.7.0" -source = "git+https://github.com/wash2/accesskit.git?tag=v0.11.0#2dee3df0a525d727df9f54ae71cfe8b47d7c2751" -dependencies = [ - "accesskit", - "accesskit_consumer", - "objc2", - "once_cell", -] - [[package]] name = "accesskit_unix" version = "0.4.0" @@ -41,31 +30,6 @@ dependencies = [ "zbus", ] -[[package]] -name = "accesskit_windows" -version = "0.14.0" -source = "git+https://github.com/wash2/accesskit.git?tag=v0.11.0#2dee3df0a525d727df9f54ae71cfe8b47d7c2751" -dependencies = [ - "accesskit", - "accesskit_consumer", - "arrayvec 0.7.4", - "once_cell", - "paste", - "windows", -] - -[[package]] -name = "accesskit_winit" -version = "0.13.0" -source = "git+https://github.com/wash2/accesskit.git?tag=v0.11.0#2dee3df0a525d727df9f54ae71cfe8b47d7c2751" -dependencies = [ - "accesskit", - "accesskit_macos", - "accesskit_unix", - "accesskit_windows", - "winit", -] - [[package]] name = "addr2line" version = "0.21.0" @@ -169,12 +133,6 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "arrayvec" version = "0.7.4" @@ -205,6 +163,9 @@ dependencies = [ "serde_repr", "tokio", "url", + "wayland-backend 0.1.2", + "wayland-client 0.30.2", + "wayland-protocols 0.30.1", "zbus", ] @@ -268,7 +229,7 @@ dependencies = [ "futures-lite", "log", "parking", - "polling", + "polling 2.8.0", "rustix 0.37.23", "slab", "socket2 0.4.9", @@ -504,25 +465,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-sys" -version = "0.1.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" -dependencies = [ - "objc-sys", -] - -[[package]] -name = "block2" -version = "0.2.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" -dependencies = [ - "block-sys", - "objc2-encode", -] - [[package]] name = "blocking" version = "1.4.0" @@ -579,16 +521,28 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "calloop" -version = "0.10.6" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e0d00eb1ea24371a97d2da6201c6747a633dc6dc1988ef503403b4c59504a8" +checksum = "aadd183e815348c0649051b1c43418643208f8ed13c8a84da7215b4e1cf42714" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "log", - "nix 0.25.1", - "slotmap", + "polling 3.2.0", + "rustix 0.38.14", + "slab", "thiserror", - "vec_map", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" +dependencies = [ + "calloop", + "rustix 0.38.14", + "wayland-backend 0.3.2", + "wayland-client 0.31.1", ] [[package]] @@ -647,56 +601,6 @@ dependencies = [ "vec_map", ] -[[package]] -name = "clipboard-win" -version = "4.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" -dependencies = [ - "error-code", - "str-buf", - "winapi", -] - -[[package]] -name = "clipboard_macos" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145a7f9e9b89453bc0a5e32d166456405d389cea5b578f57f1274b1397588a95" -dependencies = [ - "objc", - "objc-foundation", - "objc_id", -] - -[[package]] -name = "clipboard_wayland" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f6364a9f7a66f2ac1a1a098aa1c7f6b686f2496c6ac5e5c0d773445df912747" -dependencies = [ - "smithay-clipboard", -] - -[[package]] -name = "clipboard_x11" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "983a7010836ecd04dde2c6d27a0cb56ec5d21572177e782bdcb24a600124e921" -dependencies = [ - "thiserror", - "x11rb 0.9.0", -] - -[[package]] -name = "cmake" -version = "0.1.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" -dependencies = [ - "cc", -] - [[package]] name = "cocoa" version = "0.24.1" @@ -708,7 +612,7 @@ dependencies = [ "cocoa-foundation", "core-foundation", "core-graphics", - "foreign-types 0.3.2", + "foreign-types", "libc", "objc", ] @@ -783,7 +687,7 @@ dependencies = [ "bitflags 1.3.2", "core-foundation", "core-graphics-types", - "foreign-types 0.3.2", + "foreign-types", "libc", ] @@ -798,18 +702,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-text" -version = "19.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" -dependencies = [ - "core-foundation", - "core-graphics", - "foreign-types 0.3.2", - "libc", -] - [[package]] name = "cosmic-config" version = "0.1.0" @@ -846,6 +738,7 @@ dependencies = [ "pwd", "shlex", "tokio", + "wayland-client 0.31.1", ] [[package]] @@ -943,29 +836,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossfont" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21fd3add36ea31aba1520aa5288714dd63be506106753226d0eb387a93bc9c45" -dependencies = [ - "cocoa", - "core-foundation", - "core-foundation-sys", - "core-graphics", - "core-text", - "dwrote", - "foreign-types 0.5.0", - "freetype-rs", - "libc", - "log", - "objc", - "once_cell", - "pkg-config", - "servo-fontconfig", - "winapi", -] - [[package]] name = "crunchy" version = "0.2.2" @@ -993,10 +863,10 @@ dependencies = [ ] [[package]] -name = "cty" -version = "0.2.2" +name = "cursor-icon" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" +checksum = "740bb192a8e2d1350119916954f4409ee7f62f149b536911eeb78ba5a20526bf" [[package]] name = "d3d12" @@ -1009,38 +879,14 @@ dependencies = [ "winapi", ] -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - [[package]] name = "darling" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -1057,24 +903,13 @@ dependencies = [ "syn 2.0.37", ] -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core 0.13.4", - "quote", - "syn 1.0.109", -] - [[package]] name = "darling_macro" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.3", + "darling_core", "quote", "syn 2.0.37", ] @@ -1102,7 +937,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d" dependencies = [ - "darling 0.20.3", + "darling", "proc-macro2", "quote", "syn 2.0.37", @@ -1159,12 +994,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "dispatch" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" - [[package]] name = "dlib" version = "0.5.2" @@ -1186,20 +1015,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" -[[package]] -name = "dwrote" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" -dependencies = [ - "lazy_static", - "libc", - "serde", - "serde_derive", - "winapi", - "wio", -] - [[package]] name = "either" version = "1.9.0" @@ -1291,16 +1106,6 @@ dependencies = [ "libc", ] -[[package]] -name = "error-code" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" -dependencies = [ - "libc", - "str-buf", -] - [[package]] name = "etagere" version = "0.2.8" @@ -1337,16 +1142,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "expat-sys" -version = "2.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa" -dependencies = [ - "cmake", - "pkg-config", -] - [[package]] name = "exr" version = "1.6.4" @@ -1420,6 +1215,9 @@ name = "float-cmp" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] [[package]] name = "flume" @@ -1469,28 +1267,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared 0.1.1", -] - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared 0.3.1", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", + "foreign-types-shared", ] [[package]] @@ -1499,12 +1276,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - [[package]] name = "form_urlencoded" version = "1.2.0" @@ -1547,28 +1318,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "freetype-rs" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74eadec9d0a5c28c54bb9882e54787275152a4e36ce206b45d7451384e5bf5fb" -dependencies = [ - "bitflags 1.3.2", - "freetype-sys", - "libc", -] - -[[package]] -name = "freetype-sys" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" -dependencies = [ - "cmake", - "libc", - "pkg-config", -] - [[package]] name = "fsevent-sys" version = "4.1.0" @@ -1942,8 +1691,8 @@ dependencies = [ "iced_core", "iced_futures", "iced_renderer", + "iced_sctk", "iced_widget", - "iced_winit", "image", "thiserror", ] @@ -1954,7 +1703,7 @@ version = "0.1.0" source = "git+https://github.com/pop-os/libcosmic#449771bb2284a132f827fd404dc72eab99bbd852" dependencies = [ "accesskit", - "accesskit_winit", + "accesskit_unix", ] [[package]] @@ -1963,9 +1712,11 @@ version = "0.10.0" source = "git+https://github.com/pop-os/libcosmic#449771bb2284a132f827fd404dc72eab99bbd852" dependencies = [ "bitflags 1.3.2", + "iced_accessibility", "instant", "log", "palette", + "smithay-client-toolkit 0.17.0", "thiserror", "twox-hash", ] @@ -1996,7 +1747,7 @@ dependencies = [ "image", "kamadak-exif", "log", - "raw-window-handle 0.5.2", + "raw-window-handle", "thiserror", ] @@ -2009,7 +1760,7 @@ dependencies = [ "iced_tiny_skia", "iced_wgpu", "log", - "raw-window-handle 0.5.2", + "raw-window-handle", "thiserror", ] @@ -2018,11 +1769,37 @@ name = "iced_runtime" version = "0.1.1" source = "git+https://github.com/pop-os/libcosmic#449771bb2284a132f827fd404dc72eab99bbd852" dependencies = [ + "iced_accessibility", "iced_core", "iced_futures", + "smithay-client-toolkit 0.17.0", "thiserror", ] +[[package]] +name = "iced_sctk" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic#449771bb2284a132f827fd404dc72eab99bbd852" +dependencies = [ + "enum-repr", + "float-cmp", + "futures", + "iced_futures", + "iced_graphics", + "iced_runtime", + "iced_style", + "itertools", + "lazy_static", + "raw-window-handle", + "smithay-client-toolkit 0.17.0", + "smithay-clipboard", + "thiserror", + "tracing", + "wayland-backend 0.3.2", + "wayland-protocols 0.31.0", + "xkeysym", +] + [[package]] name = "iced_style" version = "0.9.0" @@ -2043,11 +1820,11 @@ dependencies = [ "iced_graphics", "kurbo", "log", - "raw-window-handle 0.5.2", + "raw-window-handle", "resvg", "rustc-hash", "softbuffer", - "tiny-skia 0.10.0", + "tiny-skia", "twox-hash", ] @@ -2065,7 +1842,7 @@ dependencies = [ "iced_graphics", "log", "once_cell", - "raw-window-handle 0.5.2", + "raw-window-handle", "resvg", "rustc-hash", "twox-hash", @@ -2082,27 +1859,11 @@ dependencies = [ "iced_style", "num-traits", "ouroboros", + "smithay-client-toolkit 0.17.0", "thiserror", "unicode-segmentation", ] -[[package]] -name = "iced_winit" -version = "0.10.0" -source = "git+https://github.com/pop-os/libcosmic#449771bb2284a132f827fd404dc72eab99bbd852" -dependencies = [ - "iced_graphics", - "iced_runtime", - "iced_style", - "log", - "raw-window-handle 0.5.2", - "thiserror", - "web-sys", - "winapi", - "window_clipboard", - "winit", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -2191,9 +1952,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", ] [[package]] @@ -2218,18 +1976,21 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" -[[package]] -name = "jni-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - [[package]] name = "jpeg-decoder" version = "0.3.0" @@ -2294,7 +2055,7 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", ] [[package]] @@ -2338,13 +2099,14 @@ dependencies = [ "iced_futures", "iced_renderer", "iced_runtime", + "iced_sctk", "iced_style", "iced_tiny_skia", "iced_widget", - "iced_winit", "lazy_static", "palette", "slotmap", + "smithay-client-toolkit 0.17.0", "thiserror", "tokio", "tracing", @@ -2448,6 +2210,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -2484,7 +2255,7 @@ dependencies = [ "bitflags 1.3.2", "block", "core-graphics-types", - "foreign-types 0.3.2", + "foreign-types", "log", "objc", ] @@ -2552,77 +2323,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "ndk" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" -dependencies = [ - "bitflags 1.3.2", - "jni-sys", - "ndk-sys", - "num_enum", - "raw-window-handle 0.5.2", - "thiserror", -] - -[[package]] -name = "ndk-context" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" - -[[package]] -name = "ndk-glue" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f" -dependencies = [ - "libc", - "log", - "ndk", - "ndk-context", - "ndk-macro", - "ndk-sys", - "once_cell", - "parking_lot 0.12.1", -] - -[[package]] -name = "ndk-macro" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" -dependencies = [ - "darling 0.13.4", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ndk-sys" -version = "0.4.1+23.1.7779620" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" -dependencies = [ - "jni-sys", -] - -[[package]] -name = "nix" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" -dependencies = [ - "bitflags 1.3.2", - "cc", - "cfg-if", - "libc", - "memoffset 0.6.5", -] - [[package]] name = "nix" version = "0.24.3" @@ -2776,27 +2476,6 @@ dependencies = [ "libc", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "objc" version = "0.2.7" @@ -2807,43 +2486,6 @@ dependencies = [ "objc_exception", ] -[[package]] -name = "objc-foundation" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" -dependencies = [ - "block", - "objc", - "objc_id", -] - -[[package]] -name = "objc-sys" -version = "0.2.0-beta.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" - -[[package]] -name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" -dependencies = [ - "block2", - "objc-sys", - "objc2-encode", -] - -[[package]] -name = "objc2-encode" -version = "2.0.0-pre.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" -dependencies = [ - "objc-sys", -] - [[package]] name = "objc_exception" version = "0.1.2" @@ -2853,15 +2495,6 @@ dependencies = [ "cc", ] -[[package]] -name = "objc_id" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" -dependencies = [ - "objc", -] - [[package]] name = "object" version = "0.32.1" @@ -3029,12 +2662,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - [[package]] name = "peeking_take_while" version = "0.1.2" @@ -3173,6 +2800,20 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "polling" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62a79e457c9898100b4298d57d69ec53d06f9a6ed352431ce5f377e082d2e846" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.14", + "tracing", + "windows-sys 0.48.0", +] + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -3256,6 +2897,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.33" @@ -3307,15 +2957,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "977b1e897f9d764566891689e642653e5ed90c6895106acd005eb4c1d0203991" -[[package]] -name = "raw-window-handle" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" -dependencies = [ - "cty", -] - [[package]] name = "raw-window-handle" version = "0.5.2" @@ -3425,7 +3066,7 @@ dependencies = [ "png", "rgb", "svgtypes", - "tiny-skia 0.10.0", + "tiny-skia", "usvg", ] @@ -3565,15 +3206,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" -[[package]] -name = "safe_arch" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05" -dependencies = [ - "bytemuck", -] - [[package]] name = "same-file" version = "1.0.6" @@ -3595,18 +3227,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sctk-adwaita" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61270629cc6b4d77ec1907db1033d5c2e1a404c412743621981a871dc9c12339" -dependencies = [ - "crossfont", - "log", - "smithay-client-toolkit", - "tiny-skia 0.7.0", -] - [[package]] name = "serde" version = "1.0.188" @@ -3649,27 +3269,6 @@ dependencies = [ "syn 2.0.37", ] -[[package]] -name = "servo-fontconfig" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c" -dependencies = [ - "libc", - "servo-fontconfig-sys", -] - -[[package]] -name = "servo-fontconfig-sys" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388" -dependencies = [ - "expat-sys", - "freetype-sys", - "pkg-config", -] - [[package]] name = "sha1" version = "0.10.6" @@ -3748,7 +3347,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" dependencies = [ "bitflags 1.3.2", - "calloop", "dlib", "lazy_static", "log", @@ -3756,8 +3354,35 @@ dependencies = [ "nix 0.24.3", "pkg-config", "wayland-client 0.29.5", - "wayland-cursor", - "wayland-protocols", + "wayland-cursor 0.29.5", + "wayland-protocols 0.29.5", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.17.0" +source = "git+https://github.com/smithay/client-toolkit?rev=dc8c4a0#dc8c4a035128208af65141fe12142a1dbc4a32bb" +dependencies = [ + "bitflags 2.4.0", + "bytemuck", + "calloop", + "calloop-wayland-source", + "cursor-icon", + "dlib", + "log", + "memmap2 0.7.1", + "nix 0.26.4", + "pkg-config", + "thiserror", + "wayland-backend 0.3.2", + "wayland-client 0.31.1", + "wayland-csd-frame", + "wayland-cursor 0.31.0", + "wayland-protocols 0.31.0", + "wayland-protocols-wlr", + "wayland-scanner 0.31.0", + "xkbcommon", + "xkeysym", ] [[package]] @@ -3766,7 +3391,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" dependencies = [ - "smithay-client-toolkit", + "smithay-client-toolkit 0.16.1", "wayland-client 0.29.5", ] @@ -3800,21 +3425,21 @@ dependencies = [ "cocoa", "core-graphics", "fastrand 1.9.0", - "foreign-types 0.3.2", + "foreign-types", "log", "nix 0.26.4", "objc", - "raw-window-handle 0.5.2", + "raw-window-handle", "redox_syscall 0.3.5", "thiserror", "wasm-bindgen", - "wayland-backend", + "wayland-backend 0.1.2", "wayland-client 0.30.2", "wayland-sys 0.30.1", "web-sys", "windows-sys 0.42.0", "x11-dl", - "x11rb 0.11.1", + "x11rb", ] [[package]] @@ -3842,12 +3467,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "str-buf" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" - [[package]] name = "strict-num" version = "0.1.1" @@ -3988,21 +3607,6 @@ dependencies = [ "weezl", ] -[[package]] -name = "tiny-skia" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642680569bb895b16e4b9d181c60be1ed136fa0c9c7f11d004daf053ba89bf82" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "bytemuck", - "cfg-if", - "png", - "safe_arch", - "tiny-skia-path 0.7.0", -] - [[package]] name = "tiny-skia" version = "0.10.0" @@ -4010,22 +3614,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7db11798945fa5c3e5490c794ccca7c6de86d3afdd54b4eb324109939c6f37bc" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec", "bytemuck", "cfg-if", "log", "png", - "tiny-skia-path 0.10.0", -] - -[[package]] -name = "tiny-skia-path" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c114d32f0c2ee43d585367cb013dfaba967ab9f62b90d9af0d696e955e70fa6c" -dependencies = [ - "arrayref", - "bytemuck", + "tiny-skia-path", ] [[package]] @@ -4318,7 +3912,7 @@ dependencies = [ "rctree", "strict-num", "svgtypes", - "tiny-skia-path 0.10.0", + "tiny-skia-path", ] [[package]] @@ -4451,6 +4045,20 @@ dependencies = [ "wayland-sys 0.30.1", ] +[[package]] +name = "wayland-backend" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19152ddd73f45f024ed4534d9ca2594e0ef252c1847695255dae47f34df9fbe4" +dependencies = [ + "cc", + "downcast-rs", + "nix 0.26.4", + "scoped-tls", + "smallvec", + "wayland-sys 0.31.1", +] + [[package]] name = "wayland-client" version = "0.29.5" @@ -4475,10 +4083,22 @@ checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" dependencies = [ "bitflags 1.3.2", "nix 0.26.4", - "wayland-backend", + "wayland-backend 0.1.2", "wayland-scanner 0.30.1", ] +[[package]] +name = "wayland-client" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" +dependencies = [ + "bitflags 2.4.0", + "nix 0.26.4", + "wayland-backend 0.3.2", + "wayland-scanner 0.31.0", +] + [[package]] name = "wayland-commons" version = "0.29.5" @@ -4491,6 +4111,17 @@ dependencies = [ "wayland-sys 0.29.5", ] +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.4.0", + "cursor-icon", + "wayland-backend 0.3.2", +] + [[package]] name = "wayland-cursor" version = "0.29.5" @@ -4502,6 +4133,17 @@ dependencies = [ "xcursor", ] +[[package]] +name = "wayland-cursor" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44aa20ae986659d6c77d64d808a046996a932aa763913864dc40c359ef7ad5b" +dependencies = [ + "nix 0.26.4", + "wayland-client 0.31.1", + "xcursor", +] + [[package]] name = "wayland-protocols" version = "0.29.5" @@ -4514,6 +4156,43 @@ dependencies = [ "wayland-scanner 0.29.5", ] +[[package]] +name = "wayland-protocols" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b28101e5ca94f70461a6c2d610f76d85ad223d042dd76585ab23d3422dd9b4d" +dependencies = [ + "bitflags 1.3.2", + "wayland-backend 0.1.2", + "wayland-client 0.30.2", + "wayland-scanner 0.30.1", +] + +[[package]] +name = "wayland-protocols" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e253d7107ba913923dc253967f35e8561a3c65f914543e46843c88ddd729e21c" +dependencies = [ + "bitflags 2.4.0", + "wayland-backend 0.3.2", + "wayland-client 0.31.1", + "wayland-scanner 0.31.0", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +dependencies = [ + "bitflags 2.4.0", + "wayland-backend 0.3.2", + "wayland-client 0.31.1", + "wayland-protocols 0.31.0", + "wayland-scanner 0.31.0", +] + [[package]] name = "wayland-scanner" version = "0.29.5" @@ -4532,7 +4211,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9b873b257fbc32ec909c0eb80dea312076a67014e65e245f5eb69a6b8ab330e" dependencies = [ "proc-macro2", - "quick-xml", + "quick-xml 0.28.2", + "quote", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb8e28403665c9f9513202b7e1ed71ec56fde5c107816843fb14057910b2c09c" +dependencies = [ + "proc-macro2", + "quick-xml 0.30.0", "quote", ] @@ -4559,6 +4249,17 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "wayland-sys" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +dependencies = [ + "dlib", + "log", + "pkg-config", +] + [[package]] name = "web-sys" version = "0.3.64" @@ -4581,14 +4282,14 @@ version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "480c965c9306872eb6255fa55e4b4953be55a8b64d57e61d7ff840d3dcc051cd" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "cfg-if", "js-sys", "log", "naga", "parking_lot 0.12.1", "profiling", - "raw-window-handle 0.5.2", + "raw-window-handle", "smallvec", "static_assertions", "wasm-bindgen", @@ -4605,7 +4306,7 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "bit-vec", "bitflags 2.4.0", "codespan-reporting", @@ -4613,7 +4314,7 @@ dependencies = [ "naga", "parking_lot 0.12.1", "profiling", - "raw-window-handle 0.5.2", + "raw-window-handle", "rustc-hash", "smallvec", "thiserror", @@ -4629,14 +4330,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ecb3258078e936deee14fd4e0febe1cfe9bbb5ffef165cb60218d2ee5eb4448" dependencies = [ "android_system_properties", - "arrayvec 0.7.4", + "arrayvec", "ash", "bit-set", "bitflags 2.4.0", "block", "core-graphics-types", "d3d12", - "foreign-types 0.3.2", + "foreign-types", "glow", "gpu-alloc", "gpu-allocator", @@ -4653,7 +4354,7 @@ dependencies = [ "parking_lot 0.12.1", "profiling", "range-alloc", - "raw-window-handle 0.5.2", + "raw-window-handle", "renderdoc-sys", "rustc-hash", "smallvec", @@ -4733,66 +4434,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "window_clipboard" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63287c9c4396ccf5346d035a9b0fcaead9e18377637f5eaa78b7ac65c873ff7d" -dependencies = [ - "clipboard-win", - "clipboard_macos", - "clipboard_wayland", - "clipboard_x11", - "raw-window-handle 0.5.2", - "thiserror", -] - [[package]] name = "windows" version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" dependencies = [ - "windows-implement", - "windows-interface", "windows-targets 0.42.2", ] -[[package]] -name = "windows-implement" -version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce87ca8e3417b02dc2a8a22769306658670ec92d78f1bd420d6310a67c245c6" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "windows-interface" -version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853f69a591ecd4f810d29f17e902d40e349fb05b0b11fff63b08b826bfe39c7f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - [[package]] name = "windows-sys" version = "0.42.0" @@ -4859,12 +4509,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -4877,12 +4521,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -4895,12 +4533,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -4913,12 +4545,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -4943,12 +4569,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -4961,38 +4581,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" -[[package]] -name = "winit" -version = "0.27.2" -source = "git+https://github.com/pop-os/winit.git?branch=iced#d35712bba65eb1dad8f6f546af49b96fdad9467e" -dependencies = [ - "bitflags 1.3.2", - "cocoa", - "core-foundation", - "core-graphics", - "dispatch", - "instant", - "libc", - "log", - "mio", - "ndk", - "ndk-glue", - "objc", - "once_cell", - "parking_lot 0.12.1", - "percent-encoding", - "raw-window-handle 0.4.3", - "raw-window-handle 0.5.2", - "sctk-adwaita", - "smithay-client-toolkit", - "wasm-bindgen", - "wayland-client 0.29.5", - "wayland-protocols", - "web-sys", - "windows-sys 0.36.1", - "x11-dl", -] - [[package]] name = "winnow" version = "0.5.15" @@ -5002,15 +4590,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "wio" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" -dependencies = [ - "winapi", -] - [[package]] name = "x11-dl" version = "2.21.0" @@ -5022,18 +4601,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "x11rb" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e99be55648b3ae2a52342f9a870c0e138709a3493261ce9b469afe6e4df6d8a" -dependencies = [ - "gethostname", - "nix 0.22.3", - "winapi", - "winapi-wsapoll", -] - [[package]] name = "x11rb" version = "0.11.1" @@ -5084,6 +4651,25 @@ dependencies = [ "winapi", ] +[[package]] +name = "xkbcommon" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52db25b599e92bf6e3904134618728eeb7b49a5a4f38f107f92399bb9c496b88" +dependencies = [ + "libc", + "memmap2 0.7.1", +] + +[[package]] +name = "xkeysym" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" +dependencies = [ + "bytemuck", +] + [[package]] name = "xml-rs" version = "0.8.19" diff --git a/Cargo.toml b/Cargo.toml index f0172bc..198bbef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ log = "0.4" pam-client = "0.5" pwd = "1" shlex = "1" +wayland-client = "0.31" [dependencies.greetd_ipc] version = "0.9" @@ -18,7 +19,7 @@ features = ["sync-codec"] [dependencies.libcosmic] git = "https://github.com/pop-os/libcosmic" default-features = false -features = ["tokio", "winit"] +features = ["tokio", "wayland"] [dependencies.tokio] version = "1" diff --git a/src/greeter.rs b/src/greeter.rs index c692b77..bf6a2b4 100644 --- a/src/greeter.rs +++ b/src/greeter.rs @@ -26,6 +26,7 @@ pub fn main() -> Result<(), Box> { } }) .map(|user| { + //TODO: use accountsservice let icon_path = Path::new("/var/lib/AccountsService/icons").join(&user.name); let icon_opt = if icon_path.is_file() { match fs::read(&icon_path) { diff --git a/src/locker.rs b/src/locker.rs index ad6b43c..a2a77d3 100644 --- a/src/locker.rs +++ b/src/locker.rs @@ -6,16 +6,48 @@ use cosmic::{ executor, iced::{ self, + event::wayland::{Event as WaylandEvent, OutputEvent}, futures::{self, SinkExt}, - subscription, Subscription, + subscription, + wayland::{ + actions::layer_surface::{IcedMargin, IcedOutput, SctkLayerSurfaceSettings}, + layer_surface::{ + destroy_layer_surface, get_layer_surface, Anchor, KeyboardInteractivity, Layer, + }, + }, + Subscription, }, + iced_runtime::core::window::Id as SurfaceId, widget, Element, }; -use std::ffi::{CStr, CString}; +use std::{ + collections::HashMap, + ffi::{CStr, CString}, + fs, + path::Path, +}; use tokio::{sync::mpsc, task, time}; +use wayland_client::{protocol::wl_output::WlOutput, Proxy}; pub fn main(current_user: pwd::Passwd) -> Result<(), Box> { - let flags = Flags { current_user }; + //TODO: use accountsservice + let icon_path = Path::new("/var/lib/AccountsService/icons").join(¤t_user.name); + let icon_opt = if icon_path.is_file() { + match fs::read(&icon_path) { + Ok(icon_data) => Some(widget::image::Handle::from_memory(icon_data)), + Err(err) => { + log::error!("failed to read {:?}: {:?}", icon_path, err); + None + } + } + } else { + None + }; + + let flags = Flags { + current_user, + icon_opt, + }; let settings = Settings::default() .antialiasing(true) @@ -23,6 +55,7 @@ pub fn main(current_user: pwd::Passwd) -> Result<(), Box> .debug(false) .default_icon_theme("Cosmic") .default_text_size(16.0) + .no_main_window(true) .scale_factor(1.0) .theme(cosmic::Theme::dark()); @@ -106,11 +139,13 @@ impl pam_client::ConversationHandler for Conversation { #[derive(Clone)] pub struct Flags { current_user: pwd::Passwd, + icon_opt: Option, } /// Messages that are used specifically by our [`App`]. #[derive(Clone, Debug)] pub enum Message { + OutputEvent(OutputEvent, WlOutput), Channel(mpsc::Sender), Prompt(String, bool, String), Submit, @@ -122,6 +157,8 @@ pub enum Message { pub struct App { core: Core, flags: Flags, + next_surface_id: SurfaceId, + surface_ids: HashMap, value_tx_opt: Option>, prompt_opt: Option<(String, bool, String)>, error_opt: Option, @@ -164,6 +201,8 @@ impl cosmic::Application for App { App { core, flags, + next_surface_id: SurfaceId(1), + surface_ids: HashMap::new(), value_tx_opt: None, prompt_opt: None, error_opt: None, @@ -177,6 +216,71 @@ impl cosmic::Application for App { /// Handle application events here. fn update(&mut self, message: Self::Message) -> Command { match message { + Message::OutputEvent(output_event, output) => match output_event { + OutputEvent::Created(_output_info_opt) => { + log::info!("output {}: created", output.id()); + + //TODO: COVER ALL OUTPUTS AFTER FIXING FOCUS BUG + if !self.surface_ids.is_empty() { + log::error!("COVER ALL OUTPUTS AFTER FIXING FOCUS BUG"); + return Command::none(); + } + + let surface_id = self.next_surface_id; + self.next_surface_id.0 += 1; + + match self.surface_ids.insert(output.clone(), surface_id) { + Some(old_surface_id) => { + //TODO: remove old surface + log::warn!( + "output {}: already had surface ID {}", + output.id(), + old_surface_id.0 + ); + } + None => {} + } + + return Command::batch([ + get_layer_surface(SctkLayerSurfaceSettings { + id: surface_id, + layer: Layer::Top, + keyboard_interactivity: KeyboardInteractivity::Exclusive, + pointer_interactivity: true, + anchor: Anchor::TOP | Anchor::BOTTOM | Anchor::LEFT | Anchor::RIGHT, + output: IcedOutput::Output(output), + namespace: "cosmic-locker".into(), + size: Some((None, None)), + margin: IcedMargin { + top: 0, + bottom: 0, + left: 0, + right: 0, + }, + exclusive_zone: 0, + size_limits: iced::Limits::NONE + .min_width(1.0) + .min_height(1.0) + .max_width(600.0), + }), + widget::text_input::focus(self.text_input_id.clone()), + ]); + } + OutputEvent::Removed => { + log::info!("output {}: removed", output.id()); + match self.surface_ids.remove(&output) { + Some(surface_id) => { + return destroy_layer_surface(surface_id); + } + None => { + log::warn!("output {}: no surface found", output.id()); + } + } + } + OutputEvent::InfoUpdate(output_info) => { + log::info!("output {}: info update {:#?}", output.id(), output_info); + } + }, Message::Channel(value_tx) => { self.value_tx_opt = Some(value_tx); } @@ -211,15 +315,20 @@ impl cosmic::Application for App { Command::none() } - /// Creates a view after each update. + // Not used for layer surface window fn view(&self) -> Element { - let mut column = widget::column::with_capacity(3).spacing(12.0); + unimplemented!() + } + + /// Creates a view after each update. + fn view_window(&self, id: SurfaceId) -> Element { + let mut column = widget::column::with_capacity(3) + .max_width(280.0) + .spacing(12.0); match &self.prompt_opt { Some((prompt, secret, value)) => { - column = column.push(widget::text(prompt.clone())); - - let mut text_input = widget::text_input("", &value) + let mut text_input = widget::text_input(&prompt, &value) .id(self.text_input_id.clone()) .on_input(|value| Message::Prompt(prompt.clone(), *secret, value)) .on_submit(Message::Submit); @@ -255,42 +364,50 @@ impl cosmic::Application for App { //TODO: how to avoid cloning this on every time subscription is called? let username = self.flags.current_user.name.clone(); - subscription::channel( - std::any::TypeId::of::(), - 16, - |mut msg_tx| async move { - loop { - let (value_tx, value_rx) = mpsc::channel(16); - msg_tx.send(Message::Channel(value_tx)).await.unwrap(); + Subscription::batch([ + subscription::events_with(|event, _| match event { + iced::Event::PlatformSpecific(iced::event::PlatformSpecific::Wayland( + WaylandEvent::Output(output_event, output), + )) => Some(Message::OutputEvent(output_event, output)), + _ => None, + }), + subscription::channel( + std::any::TypeId::of::(), + 16, + |mut msg_tx| async move { + loop { + let (value_tx, value_rx) = mpsc::channel(16); + msg_tx.send(Message::Channel(value_tx)).await.unwrap(); - let pam_res = { - let username = username.clone(); - let msg_tx = msg_tx.clone(); - task::spawn_blocking(move || { - pam_thread(username, Conversation { msg_tx, value_rx }) - }) - .await - .unwrap() - }; + let pam_res = { + let username = username.clone(); + let msg_tx = msg_tx.clone(); + task::spawn_blocking(move || { + pam_thread(username, Conversation { msg_tx, value_rx }) + }) + .await + .unwrap() + }; - match pam_res { - Ok(()) => { - log::info!("successfully authenticated"); - msg_tx.send(Message::Exit).await.unwrap(); - break; - } - Err(err) => { - log::info!("authentication error: {:?}", err); - msg_tx.send(Message::Error(err.to_string())).await.unwrap(); + match pam_res { + Ok(()) => { + log::info!("successfully authenticated"); + msg_tx.send(Message::Exit).await.unwrap(); + break; + } + Err(err) => { + log::info!("authentication error: {:?}", err); + msg_tx.send(Message::Error(err.to_string())).await.unwrap(); + } } } - } - //TODO: how to properly kill this task? - loop { - time::sleep(time::Duration::new(1, 0)).await; - } - }, - ) + //TODO: how to properly kill this task? + loop { + time::sleep(time::Duration::new(1, 0)).await; + } + }, + ), + ]) } }