From b604fd2312adc2f23f1da03e957ac75752965871 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 24 Feb 2026 15:18:57 -0500 Subject: [PATCH 1/9] chore: updates after iced rebase --- Cargo.lock | 933 ++++++++++---------------- Cargo.toml | 14 +- cosmic-comp-config/Cargo.toml | 2 +- src/shell/element/resize_indicator.rs | 13 +- src/shell/element/stack.rs | 3 +- src/shell/element/stack/tab.rs | 72 +- src/shell/element/stack/tab_text.rs | 9 +- src/shell/element/stack/tabs.rs | 121 ++-- src/shell/element/stack_hover.rs | 5 +- src/shell/element/swap_indicator.rs | 5 +- src/shell/grabs/menu/item.rs | 24 +- src/shell/grabs/menu/mod.rs | 9 +- src/shell/zoom.rs | 1 + src/utils/iced.rs | 51 +- src/utils/mod.rs | 1 + src/utils/state.rs | 222 ++++++ 16 files changed, 751 insertions(+), 734 deletions(-) create mode 100644 src/utils/state.rs diff --git a/Cargo.lock b/Cargo.lock index 66cffb298..585adde39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -83,7 +83,7 @@ dependencies = [ "log", "ndk", "ndk-context", - "ndk-sys 0.6.0+11769913", + "ndk-sys", "num_enum", "thiserror 1.0.69", ] @@ -268,7 +268,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -303,7 +303,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -337,7 +337,7 @@ dependencies = [ "derive_utils", "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -384,18 +384,18 @@ dependencies = [ [[package]] name = "bit-set" -version = "0.6.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0481a0e032742109b1133a095184ee93d88f3dc9e0d28a5d033dc77a073f44f" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c54ff287cfc0a34f38a6b832ea1bd8e448a330b3e40a50859e6488bee07f22" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitflags" @@ -449,6 +449,15 @@ dependencies = [ "piper", ] +[[package]] +name = "borsh" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1da5ab77c1437701eeff7c88d968729e7766172279eab0676857b3d63af7a6f" +dependencies = [ + "cfg_aliases", +] + [[package]] name = "bstr" version = "1.12.1" @@ -498,7 +507,7 @@ checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -599,12 +608,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - [[package]] name = "cfg_aliases" version = "0.2.1" @@ -639,8 +642,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" dependencies = [ "iana-time-zone", + "js-sys", "num-traits", "serde", + "wasm-bindgen", "windows-link", ] @@ -720,12 +725,11 @@ dependencies = [ [[package]] name = "codespan-reporting" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" dependencies = [ - "termcolor", - "unicode-width", + "unicode-width 0.2.2", ] [[package]] @@ -734,37 +738,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" -[[package]] -name = "com" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" -dependencies = [ - "com_macros", -] - -[[package]] -name = "com_macros" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" -dependencies = [ - "com_macros_support", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "com_macros_support" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "combine" version = "4.6.7" @@ -784,12 +757,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "configparser" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57e3272f0190c3f1584272d613719ba5fc7df7f4942fe542e63d949cf3a649b" - [[package]] name = "core-foundation" version = "0.9.4" @@ -884,7 +851,7 @@ dependencies = [ "log-panics", "logind-zbus", "ordered-float", - "parking_lot 0.12.5", + "parking_lot", "png 0.18.1", "profiling", "rand 0.10.0", @@ -930,7 +897,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "atomicwrites", "calloop 0.14.4", @@ -951,10 +918,10 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -998,7 +965,7 @@ dependencies = [ [[package]] name = "cosmic-settings-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-settings-daemon#defa9f790432c70054ca1f39737d879ada5d0252" +source = "git+https://github.com/pop-os/cosmic-settings-daemon?branch=iced-rebase#4e98c993f7284e5f565fdd1385c51f9ce1084d91" dependencies = [ "cosmic-config", "ron 0.11.0", @@ -1019,7 +986,7 @@ dependencies = [ [[package]] name = "cosmic-settings-daemon-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-settings-daemon#defa9f790432c70054ca1f39737d879ada5d0252" +source = "git+https://github.com/pop-os/cosmic-settings-daemon?branch=iced-rebase#4e98c993f7284e5f565fdd1385c51f9ce1084d91" dependencies = [ "cosmic-config", "cosmic-theme", @@ -1032,7 +999,7 @@ version = "0.18.2" source = "git+https://github.com/pop-os/cosmic-text.git#f31b9d86959676d97fde54ff5907a58ab4308897" dependencies = [ "bitflags 2.11.0", - "fontdb 0.23.0", + "fontdb", "harfrust", "linebender_resource_handle", "log", @@ -1052,10 +1019,9 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "almost", - "configparser", "cosmic-config", "csscolorparser", "dirs", @@ -1105,6 +1071,18 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" +[[package]] +name = "cryoglyph" +version = "0.1.0" +source = "git+https://github.com/pop-os/glyphon.git?branch=iced-0.14#c49de15bce4d8254ac136d1be9911960cc85ce12" +dependencies = [ + "cosmic-text", + "etagere", + "lru", + "rustc-hash 2.1.1", + "wgpu", +] + [[package]] name = "crypto-common" version = "0.1.7" @@ -1145,17 +1123,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" -[[package]] -name = "d3d12" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbd1f579714e3c809ebd822c81ef148b1ceaeb3d535352afc73fd0c4c6a0017" -dependencies = [ - "bitflags 2.11.0", - "libloading", - "winapi", -] - [[package]] name = "darling" version = "0.21.3" @@ -1177,7 +1144,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.117", + "syn", ] [[package]] @@ -1188,7 +1155,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -1216,7 +1183,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -1227,7 +1194,7 @@ checksum = "ccfae181bab5ab6c5478b2ccb69e4c68a02f8c3ec72f6616bfec9dbc599d2ee0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -1276,7 +1243,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -1448,7 +1415,7 @@ dependencies = [ "ahash", "bytemuck", "egui", - "glow 0.16.0", + "glow", "log", "memoffset", "profiling", @@ -1509,7 +1476,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -1530,7 +1497,7 @@ checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -1546,7 +1513,7 @@ dependencies = [ "emath", "epaint_default_fonts", "nohash-hasher", - "parking_lot 0.12.5", + "parking_lot", "profiling", ] @@ -1670,6 +1637,15 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +[[package]] +name = "float-cmp" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" +dependencies = [ + "num-traits", +] + [[package]] name = "float_next_after" version = "1.0.0" @@ -1733,6 +1709,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "font-types" version = "0.10.1" @@ -1760,20 +1742,6 @@ dependencies = [ "roxmltree 0.20.0", ] -[[package]] -name = "fontdb" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e32eac81c1135c1df01d4e6d4233c47ba11f6a6d07f33e0bba09d18797077770" -dependencies = [ - "fontconfig-parser", - "log", - "memmap2", - "slotmap", - "tinyvec", - "ttf-parser 0.21.1", -] - [[package]] name = "fontdb" version = "0.23.0" @@ -1785,7 +1753,7 @@ dependencies = [ "memmap2", "slotmap", "tinyvec", - "ttf-parser 0.25.1", + "ttf-parser", ] [[package]] @@ -1806,7 +1774,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -1902,7 +1870,7 @@ checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -2061,18 +2029,6 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" -[[package]] -name = "glow" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" -dependencies = [ - "js-sys", - "slotmap", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "glow" version = "0.16.0" @@ -2085,67 +2041,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "glutin_wgl_sys" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" -dependencies = [ - "gl_generator", -] - -[[package]] -name = "gpu-alloc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" -dependencies = [ - "bitflags 2.11.0", - "gpu-alloc-types", -] - -[[package]] -name = "gpu-alloc-types" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" -dependencies = [ - "bitflags 2.11.0", -] - -[[package]] -name = "gpu-allocator" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd4240fc91d3433d5e5b0fc5b67672d771850dc19bbee03c1381e19322803d7" -dependencies = [ - "log", - "presser", - "thiserror 1.0.69", - "winapi", - "windows", -] - -[[package]] -name = "gpu-descriptor" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca" -dependencies = [ - "bitflags 2.11.0", - "gpu-descriptor-types", - "hashbrown 0.15.5", -] - -[[package]] -name = "gpu-descriptor-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" -dependencies = [ - "bitflags 2.11.0", -] - [[package]] name = "grid" version = "1.0.0" @@ -2170,6 +2065,7 @@ checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" dependencies = [ "cfg-if", "crunchy", + "num-traits", "zerocopy", ] @@ -2198,7 +2094,7 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "foldhash", + "foldhash 0.1.5", ] [[package]] @@ -2206,20 +2102,8 @@ name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" - -[[package]] -name = "hassle-rs" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 2.11.0", - "com", - "libc", - "libloading", - "thiserror 1.0.69", - "widestring", - "winapi", + "foldhash 0.2.0", ] [[package]] @@ -2303,7 +2187,7 @@ dependencies = [ "i18n-embed-impl", "intl-memoizer", "log", - "parking_lot 0.12.5", + "parking_lot", "rust-embed", "sys-locale", "thiserror 1.0.69", @@ -2326,7 +2210,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.117", + "syn", "unic-langid", ] @@ -2340,7 +2224,7 @@ dependencies = [ "i18n-config", "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -2355,7 +2239,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.62.2", + "windows-core", ] [[package]] @@ -2369,72 +2253,73 @@ dependencies = [ [[package]] name = "iced" -version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +version = "0.14.0" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "dnd", "iced_core", + "iced_debug", "iced_futures", + "iced_program", "iced_renderer", + "iced_runtime", "iced_widget", "image", "mime 0.1.0", - "thiserror 1.0.69", + "thiserror 2.0.18", "window_clipboard", ] [[package]] name = "iced_core" -version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +version = "0.14.0" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "bitflags 2.11.0", "bytes", "dnd", "glam", + "lilt", "log", "mime 0.1.0", "num-traits", - "once_cell", "palette", "raw-window-handle", "rustc-hash 2.1.1", "serde", - "smol_str 0.2.2", - "thiserror 1.0.69", + "smol_str 0.3.5", + "thiserror 2.0.18", "web-time", "window_clipboard", ] [[package]] -name = "iced_futures" -version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +name = "iced_debug" +version = "0.14.0" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ - "futures", "iced_core", + "iced_futures", "log", - "rustc-hash 2.1.1", - "wasm-bindgen-futures", - "wasm-timer", ] [[package]] -name = "iced_glyphon" -version = "0.6.0" -source = "git+https://github.com/pop-os/glyphon.git?tag=iced-0.14-dev#6ef9d12a20cfd0f7bdf38136a26ded9f7459ec8b" +name = "iced_futures" +version = "0.14.0" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ - "cosmic-text", - "etagere", - "lru", + "futures", + "iced_core", + "log", "rustc-hash 2.1.1", - "wgpu", + "wasm-bindgen-futures", + "wasmtimer", ] [[package]] name = "iced_graphics" -version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +version = "0.14.0" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "bitflags 2.11.0", "bytemuck", @@ -2446,50 +2331,59 @@ dependencies = [ "kamadak-exif", "log", "lyon_path", - "once_cell", "raw-window-handle", "rustc-hash 2.1.1", - "thiserror 1.0.69", + "thiserror 2.0.18", "unicode-segmentation", ] +[[package]] +name = "iced_program" +version = "0.14.0" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +dependencies = [ + "iced_graphics", + "iced_runtime", +] + [[package]] name = "iced_renderer" -version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +version = "0.14.0" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "iced_graphics", "iced_tiny_skia", "iced_wgpu", "log", - "thiserror 1.0.69", + "thiserror 2.0.18", ] [[package]] name = "iced_runtime" -version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +version = "0.14.0" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "bytes", "dnd", "iced_core", "iced_futures", "raw-window-handle", - "thiserror 1.0.69", + "thiserror 2.0.18", "window_clipboard", ] [[package]] name = "iced_tiny_skia" -version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +version = "0.14.0" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "bytemuck", "cosmic-text", + "iced_debug", "iced_graphics", "kurbo 0.10.4", "log", - "resvg 0.42.0", + "resvg 0.45.1", "rustc-hash 2.1.1", "softbuffer", "tiny-skia", @@ -2497,26 +2391,26 @@ dependencies = [ [[package]] name = "iced_wgpu" -version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +version = "0.14.0" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "as-raw-xcb-connection", "bitflags 2.11.0", "bytemuck", "cosmic-client-toolkit", + "cryoglyph", "futures", "glam", "guillotiere", - "iced_glyphon", + "iced_debug", "iced_graphics", "log", "lyon", - "once_cell", "raw-window-handle", - "resvg 0.42.0", + "resvg 0.45.1", "rustc-hash 2.1.1", "rustix 0.38.44", - "thiserror 1.0.69", + "thiserror 2.0.18", "tiny-xlib", "wayland-backend", "wayland-client", @@ -2528,18 +2422,17 @@ dependencies = [ [[package]] name = "iced_widget" -version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +version = "0.14.2" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "dnd", "iced_renderer", "iced_runtime", "log", "num-traits", - "once_cell", "ouroboros", "rustc-hash 2.1.1", - "thiserror 1.0.69", + "thiserror 2.0.18", "unicode-segmentation", "window_clipboard", ] @@ -2677,8 +2570,18 @@ dependencies = [ "moxcms", "num-traits", "png 0.18.1", - "zune-core", - "zune-jpeg", + "zune-core 0.5.1", + "zune-jpeg 0.5.12", +] + +[[package]] +name = "image-webp" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" +dependencies = [ + "byteorder-lite", + "quick-error", ] [[package]] @@ -2687,6 +2590,12 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" +[[package]] +name = "imagesize" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285" + [[package]] name = "indexmap" version = "1.9.3" @@ -2749,15 +2658,6 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd4f5b4d1c00331c5245163aacfe5f20be75b564c7112d45893d4ae038119eb0" -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - [[package]] name = "intl-memoizer" version = "0.5.3" @@ -2794,47 +2694,6 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" -[[package]] -name = "jiff" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e3d65f018c6ae946ab16e80944b97096ed73c35b221d1c478a6c81d8f57940" -dependencies = [ - "jiff-static", - "jiff-tzdb-platform", - "log", - "portable-atomic", - "portable-atomic-util", - "serde_core", - "windows-sys 0.61.2", -] - -[[package]] -name = "jiff-static" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17c2b211d863c7fde02cbea8a3c1a439b98e109286554f2860bdded7ff83818" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "jiff-tzdb" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68971ebff725b9e2ca27a601c5eb38a4c5d64422c4cbab0c535f248087eda5c2" - -[[package]] -name = "jiff-tzdb-platform" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" -dependencies = [ - "jiff-tzdb", -] - [[package]] name = "jni" version = "0.21.1" @@ -2867,17 +2726,11 @@ dependencies = [ "libc", ] -[[package]] -name = "jpeg-decoder" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07" - [[package]] name = "js-sys" -version = "0.3.88" +version = "0.3.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e709f3e3d22866f9c25b3aff01af289b18422cc8b4262fb19103ee80fe513d" +checksum = "f4eacb0641a310445a4c513f2a5e23e19952e269c6a38887254d5f837a305506" dependencies = [ "once_cell", "wasm-bindgen", @@ -2885,9 +2738,9 @@ dependencies = [ [[package]] name = "kamadak-exif" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4fc70d0ab7e5b6bafa30216a6b48705ea964cdfc29c050f2412295eba58077" +checksum = "1130d80c7374efad55a117d715a3af9368f0fa7a2c54573afc15a188cd984837" dependencies = [ "mutate_once", ] @@ -2913,17 +2766,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "khronos-egl" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" -dependencies = [ - "libc", - "libloading", - "pkg-config", -] - [[package]] name = "khronos_api" version = "3.1.0" @@ -3010,16 +2852,18 @@ checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "libcosmic" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/#384e8f6e219bb458720eafa5bb971b832c057f23" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" dependencies = [ "apply", "auto_enums", + "chrono", "cosmic-config", "cosmic-freedesktop-icons", "cosmic-settings-daemon", "cosmic-theme", "css-color", "derive_setters", + "float-cmp 0.10.0", "futures", "i18n-embed", "i18n-embed-fl", @@ -3031,7 +2875,6 @@ dependencies = [ "iced_tiny_skia", "iced_widget", "image", - "jiff", "log", "palette", "phf 0.13.1", @@ -3068,7 +2911,7 @@ checksum = "8dc2c710cf5819e91220a446d9e64acc6814386cc22c509c3f0df83c0b874a98" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -3105,7 +2948,7 @@ checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" dependencies = [ "bitflags 2.11.0", "libc", - "redox_syscall 0.7.1", + "redox_syscall 0.7.2", ] [[package]] @@ -3156,6 +2999,15 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "lilt" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67562e5eff6b20553fa9be1c503356768420994e28f67e3eafe6f41910e57ad" +dependencies = [ + "web-time", +] + [[package]] name = "linebender_resource_handle" version = "0.1.1" @@ -3242,9 +3094,9 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.5" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593" [[package]] name = "lyon" @@ -3340,21 +3192,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "metal" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" -dependencies = [ - "bitflags 2.11.0", - "block", - "core-graphics-types", - "foreign-types", - "log", - "objc", - "paste", -] - [[package]] name = "miette" version = "7.6.0" @@ -3362,7 +3199,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "cfg-if", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] @@ -3437,23 +3274,27 @@ checksum = "13d2233c9842d08cfe13f9eac96e207ca6a2ea10b80259ebe8ad0268be27d2af" [[package]] name = "naga" -version = "22.1.0" +version = "27.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bd5a652b6faf21496f2cfd88fc49989c8db0825d1f6746b1a71a6ede24a63ad" +checksum = "066cf25f0e8b11ee0df221219010f213ad429855f57c494f995590c861a9a7d8" dependencies = [ "arrayvec", "bit-set", "bitflags 2.11.0", - "cfg_aliases 0.1.1", + "cfg-if", + "cfg_aliases", "codespan-reporting", + "half", + "hashbrown 0.16.1", "hexf-parse", "indexmap 2.13.0", + "libm", "log", + "num-traits", + "once_cell", "rustc-hash 1.1.0", - "spirv", - "termcolor", - "thiserror 1.0.69", - "unicode-xid", + "thiserror 2.0.18", + "unicode-ident", ] [[package]] @@ -3465,7 +3306,7 @@ dependencies = [ "bitflags 2.11.0", "jni-sys", "log", - "ndk-sys 0.6.0+11769913", + "ndk-sys", "num_enum", "raw-window-handle", "thiserror 1.0.69", @@ -3477,15 +3318,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" -[[package]] -name = "ndk-sys" -version = "0.5.0+25.2.9519653" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" -dependencies = [ - "jni-sys", -] - [[package]] name = "ndk-sys" version = "0.6.0+11769913" @@ -3503,7 +3335,7 @@ checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.11.0", "cfg-if", - "cfg_aliases 0.2.1", + "cfg_aliases", "libc", "memoffset", ] @@ -3658,7 +3490,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -3973,7 +3805,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -3982,7 +3814,7 @@ version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" dependencies = [ - "ttf-parser 0.25.1", + "ttf-parser", ] [[package]] @@ -4007,7 +3839,7 @@ dependencies = [ "by_address", "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -4016,17 +3848,6 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.5" @@ -4034,21 +3855,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", - "parking_lot_core 0.9.12", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -4127,7 +3934,7 @@ dependencies = [ "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 2.0.117", + "syn", "unicase", ] @@ -4141,7 +3948,7 @@ dependencies = [ "phf_shared 0.13.1", "proc-macro2", "quote", - "syn 2.0.117", + "syn", "uncased", ] @@ -4188,7 +3995,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -4317,12 +4124,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "presser" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" - [[package]] name = "prettyplease" version = "0.2.37" @@ -4330,7 +4131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.117", + "syn", ] [[package]] @@ -4361,7 +4162,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -4381,7 +4182,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", "version_check", "yansi", ] @@ -4403,7 +4204,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b" dependencies = [ "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -4415,6 +4216,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quick-xml" version = "0.38.4" @@ -4500,12 +4307,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" -[[package]] -name = "range-alloc" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde" - [[package]] name = "rangemap" version = "1.7.1" @@ -4545,15 +4346,6 @@ dependencies = [ "font-types 0.11.0", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -4574,9 +4366,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35985aa610addc02e24fc232012c86fd11f14111180f902b67e2d5331f8ebf2b" +checksum = "6d94dd2f7cd932d4dc02cc8b2b50dfd38bd079a4e5d79198b99743d7fcf9a4b4" dependencies = [ "bitflags 2.11.0", ] @@ -4609,7 +4401,7 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -4637,9 +4429,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" [[package]] name = "renderdoc-sys" @@ -4663,18 +4455,19 @@ dependencies = [ [[package]] name = "resvg" -version = "0.42.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "944d052815156ac8fa77eaac055220e95ba0b01fa8887108ca710c03805d9051" +checksum = "a8928798c0a55e03c9ca6c4c6846f76377427d2c1e1f7e6de3c06ae57942df43" dependencies = [ "gif", - "jpeg-decoder", + "image-webp", "log", "pico-args", "rgb", "svgtypes 0.15.3", "tiny-skia", - "usvg 0.42.0", + "usvg 0.45.1", + "zune-jpeg 0.4.21", ] [[package]] @@ -4745,7 +4538,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.117", + "syn", "walkdir", ] @@ -4811,14 +4604,16 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "rustybuzz" -version = "0.14.1" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb9cf8877777222e4a3bc7eb247e398b56baba500c38c1c46842431adc8b55c" +checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702" dependencies = [ "bitflags 2.11.0", "bytemuck", + "core_maths", + "log", "smallvec", - "ttf-parser 0.21.1", + "ttf-parser", "unicode-bidi-mirroring", "unicode-ccc", "unicode-properties", @@ -4927,7 +4722,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -4952,7 +4747,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -4992,7 +4787,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -5121,7 +4916,7 @@ dependencies = [ "errno", "gbm", "gl_generator", - "glow 0.16.0", + "glow", "indexmap 2.13.0", "input", "libc", @@ -5249,6 +5044,10 @@ name = "smol_str" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f7a918bd2a9951d18ee6e48f076843e8e73a9a5d22cf05bcd4b7a81bdd04e17" +dependencies = [ + "borsh", + "serde_core", +] [[package]] name = "snowflake" @@ -5263,7 +5062,7 @@ source = "git+https://github.com/pop-os/softbuffer?tag=cosmic-4.0#a3f77e251e7422 dependencies = [ "as-raw-xcb-connection", "bytemuck", - "cfg_aliases 0.2.1", + "cfg_aliases", "cocoa", "core-graphics", "drm 0.11.1", @@ -5286,15 +5085,6 @@ dependencies = [ "x11rb", ] -[[package]] -name = "spirv" -version = "0.3.0+sdk-1.3.268.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" -dependencies = [ - "bitflags 2.11.0", -] - [[package]] name = "stable_deref_trait" version = "1.2.1" @@ -5313,7 +5103,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" dependencies = [ - "float-cmp", + "float-cmp 0.9.0", ] [[package]] @@ -5365,17 +5155,6 @@ dependencies = [ "zeno", ] -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.117" @@ -5395,7 +5174,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -5440,9 +5219,9 @@ checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c" [[package]] name = "tempfile" -version = "3.25.0" +version = "3.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" +checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0" dependencies = [ "fastrand", "getrandom 0.4.1", @@ -5451,15 +5230,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -5486,7 +5256,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -5497,7 +5267,7 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -5687,7 +5457,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -5761,12 +5531,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "ttf-parser" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" - [[package]] name = "ttf-parser" version = "0.25.1" @@ -5862,15 +5626,15 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-bidi-mirroring" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86" +checksum = "5dfa6e8c60bb66d49db113e0125ee8711b7647b5579dc7f5f19c42357ed039fe" [[package]] name = "unicode-ccc" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" +checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e" [[package]] name = "unicode-ident" @@ -5914,6 +5678,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + [[package]] name = "unicode-xid" version = "0.2.6" @@ -5948,15 +5718,15 @@ dependencies = [ [[package]] name = "usvg" -version = "0.42.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84ea542ae85c715f07b082438a4231c3760539d902e11d093847a0b22963032" +checksum = "80be9b06fbae3b8b303400ab20778c80bbaf338f563afe567cf3c9eea17b47ef" dependencies = [ "base64 0.22.1", "data-url", "flate2", - "fontdb 0.18.0", - "imagesize", + "fontdb", + "imagesize 0.13.0", "kurbo 0.11.3", "log", "pico-args", @@ -5981,7 +5751,7 @@ checksum = "9bd4e3c291f45d152929a31f0f6c819245e2921bfd01e7bd91201a9af39a2bdc" dependencies = [ "data-url", "flate2", - "imagesize", + "imagesize 0.12.0", "kurbo 0.9.5", "log", "roxmltree 0.19.0", @@ -6074,9 +5844,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.111" +version = "0.2.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec1adf1535672f5b7824f817792b1afd731d7e843d2d04ec8f27e8cb51edd8ac" +checksum = "05d7d0fce354c88b7982aec4400b3e7fcf723c32737cef571bd165f7613557ee" dependencies = [ "cfg-if", "once_cell", @@ -6087,9 +5857,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.61" +version = "0.4.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe88540d1c934c4ec8e6db0afa536876c5441289d7f9f9123d4f065ac1250a6b" +checksum = "ee85afca410ac4abba5b584b12e77ea225db6ee5471d0aebaae0861166f9378a" dependencies = [ "cfg-if", "futures-util", @@ -6101,9 +5871,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.111" +version = "0.2.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e638317c08b21663aed4d2b9a2091450548954695ff4efa75bff5fa546b3b1" +checksum = "55839b71ba921e4f75b674cb16f843f4b1f3b26ddfcb3454de1cf65cc021ec0f" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6111,22 +5881,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.111" +version = "0.2.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c64760850114d03d5f65457e96fc988f11f01d38fbaa51b254e4ab5809102af" +checksum = "caf2e969c2d60ff52e7e98b7392ff1588bffdd1ccd4769eba27222fd3d621571" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.117", + "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.111" +version = "0.2.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60eecd4fe26177cfa3339eb00b4a36445889ba3ad37080c2429879718e20ca41" +checksum = "0861f0dcdf46ea819407495634953cdcc8a8c7215ab799a7a7ce366be71c7b30" dependencies = [ "unicode-ident", ] @@ -6153,21 +5923,6 @@ dependencies = [ "wasmparser", ] -[[package]] -name = "wasm-timer" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" -dependencies = [ - "futures", - "js-sys", - "parking_lot 0.11.2", - "pin-utils", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "wasmparser" version = "0.244.0" @@ -6180,6 +5935,20 @@ dependencies = [ "semver", ] +[[package]] +name = "wasmtimer" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c598d6b99ea013e35844697fc4670d08339d5cda15588f193c6beedd12f644b" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] + [[package]] name = "wayland-backend" version = "0.3.12" @@ -6343,9 +6112,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.88" +version = "0.3.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6bb20ed2d9572df8584f6dc81d68a41a625cadc6f15999d649a70ce7e3597a" +checksum = "10053fbf9a374174094915bbce141e87a6bf32ecd9a002980db4b638405e8962" dependencies = [ "js-sys", "wasm-bindgen", @@ -6369,24 +6138,22 @@ checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" [[package]] name = "wgpu" -version = "22.1.0" +version = "27.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d1c4ba43f80542cf63a0a6ed3134629ae73e8ab51e4b765a67f3aa062eb433" +checksum = "bfe68bac7cde125de7a731c3400723cadaaf1703795ad3f4805f187459cd7a77" dependencies = [ "arrayvec", - "cfg_aliases 0.1.1", + "bitflags 2.11.0", + "cfg-if", + "cfg_aliases", "document-features", - "js-sys", + "hashbrown 0.16.1", "log", - "naga", - "parking_lot 0.12.5", + "portable-atomic", "profiling", "raw-window-handle", "smallvec", "static_assertions", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", "wgpu-core", "wgpu-hal", "wgpu-types", @@ -6394,91 +6161,77 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "22.1.0" +version = "27.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0348c840d1051b8e86c3bcd31206080c5e71e5933dabd79be1ce732b0b2f089a" +checksum = "27a75de515543b1897b26119f93731b385a19aea165a1ec5f0e3acecc229cae7" dependencies = [ "arrayvec", + "bit-set", "bit-vec", "bitflags 2.11.0", - "cfg_aliases 0.1.1", + "bytemuck", + "cfg_aliases", "document-features", + "hashbrown 0.16.1", "indexmap 2.13.0", "log", "naga", "once_cell", - "parking_lot 0.12.5", + "parking_lot", + "portable-atomic", "profiling", "raw-window-handle", "rustc-hash 1.1.0", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.18", + "wgpu-core-deps-windows-linux-android", "wgpu-hal", "wgpu-types", ] +[[package]] +name = "wgpu-core-deps-windows-linux-android" +version = "27.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71197027d61a71748e4120f05a9242b2ad142e3c01f8c1b47707945a879a03c3" +dependencies = [ + "wgpu-hal", +] + [[package]] name = "wgpu-hal" -version = "22.0.0" +version = "27.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bbf4b4de8b2a83c0401d9e5ae0080a2792055f25859a02bf9be97952bbed4f" +checksum = "5b21cb61c57ee198bc4aff71aeadff4cbb80b927beb912506af9c780d64313ce" dependencies = [ - "android_system_properties", - "arrayvec", - "ash", - "bit-set", "bitflags 2.11.0", - "block", - "cfg_aliases 0.1.1", - "core-graphics-types", - "d3d12", - "glow 0.13.1", - "glutin_wgl_sys", - "gpu-alloc", - "gpu-allocator", - "gpu-descriptor", - "hassle-rs", - "js-sys", - "khronos-egl", - "libc", + "cfg-if", + "cfg_aliases", "libloading", "log", - "metal", "naga", - "ndk-sys 0.5.0+25.2.9519653", - "objc", - "once_cell", - "parking_lot 0.12.5", - "profiling", - "range-alloc", + "portable-atomic", + "portable-atomic-util", "raw-window-handle", "renderdoc-sys", - "rustc-hash 1.1.0", - "smallvec", - "thiserror 1.0.69", - "wasm-bindgen", - "web-sys", + "thiserror 2.0.18", "wgpu-types", - "winapi", ] [[package]] name = "wgpu-types" -version = "22.0.0" +version = "27.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9d91f0e2c4b51434dfa6db77846f2793149d8e73f800fa2e41f52b8eac3c5d" +checksum = "afdcf84c395990db737f2dd91628706cb31e86d72e53482320d368e52b5da5eb" dependencies = [ "bitflags 2.11.0", + "bytemuck", "js-sys", + "log", + "thiserror 2.0.18", "web-sys", ] -[[package]] -name = "widestring" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" - [[package]] name = "winapi" version = "0.3.9" @@ -6525,25 +6278,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "windows" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" -dependencies = [ - "windows-core 0.52.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-core" version = "0.62.2" @@ -6565,7 +6299,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -6576,7 +6310,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -6913,7 +6647,7 @@ dependencies = [ "block2", "bytemuck", "calloop 0.13.0", - "cfg_aliases 0.2.1", + "cfg_aliases", "concurrent-queue", "core-foundation", "core-graphics", @@ -6999,7 +6733,7 @@ dependencies = [ "heck 0.5.0", "indexmap 2.13.0", "prettyplease", - "syn 2.0.117", + "syn", "wasm-metadata", "wit-bindgen-core", "wit-component", @@ -7015,7 +6749,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.117", + "syn", "wit-bindgen-core", "wit-bindgen-rust", ] @@ -7204,7 +6938,7 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", "synstructure", ] @@ -7252,7 +6986,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.117", + "syn", "zbus_names", "zvariant", "zvariant_utils", @@ -7292,7 +7026,7 @@ checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -7312,7 +7046,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", "synstructure", ] @@ -7347,7 +7081,7 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn", ] [[package]] @@ -7356,19 +7090,34 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + [[package]] name = "zune-core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb8a0807f7c01457d0379ba880ba6322660448ddebc890ce29bb64da71fb40f9" +[[package]] +name = "zune-jpeg" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713" +dependencies = [ + "zune-core 0.4.12", +] + [[package]] name = "zune-jpeg" version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "410e9ecef634c709e3831c2cfdb8d9c32164fae1c67496d5b68fff728eec37fe" dependencies = [ - "zune-core", + "zune-core 0.5.1", ] [[package]] @@ -7394,7 +7143,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.117", + "syn", "zvariant_utils", ] @@ -7407,6 +7156,6 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.117", + "syn", "winnow 0.7.14", ] diff --git a/Cargo.toml b/Cargo.toml index 0a35babed..1142eebfe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,14 +20,18 @@ cosmic-comp-config = { path = "cosmic-comp-config", features = [ cosmic-config = { git = "https://github.com/pop-os/libcosmic/", features = [ "calloop", "macro", -] } +], branch = "iced-rebase" } cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", rev = "160b086", default-features = false, features = [ "server", ] } -cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon" } +cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon", branch = "iced-rebase" } cosmic-settings-daemon-config = { git = "https://github.com/pop-os/cosmic-settings-daemon", features = [ "greeter", -] } +], branch = "iced-rebase" } +# cosmic-settings-config = { path = "../cosmic-settings-daemon/config" } +# cosmic-settings-daemon-config = { path = "../cosmic-settings-daemon/cosmic-settings-daemon-config", features = [ +# "greeter", +# ] } cosmic-text = { git = "https://github.com/pop-os/cosmic-text.git", features = [ "shape-run-cache", ] } @@ -39,11 +43,11 @@ i18n-embed = { version = "0.16", features = [ "desktop-requester", ] } i18n-embed-fl = "0.10" -iced_tiny_skia = { git = "https://github.com/pop-os/libcosmic/" } +iced_tiny_skia = { git = "https://github.com/pop-os/libcosmic", branch = "iced-rebase" } indexmap = "2.13" keyframe = "1.1.1" libc = "0.2.182" -libcosmic = { git = "https://github.com/pop-os/libcosmic/", default-features = false } +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, branch = "iced-rebase" } libsystemd = { version = "0.7", optional = true } log-panics = { version = "2", features = ["with-backtrace"] } ordered-float = "5.1" diff --git a/cosmic-comp-config/Cargo.toml b/cosmic-comp-config/Cargo.toml index 66cdbfff7..a964efa3c 100644 --- a/cosmic-comp-config/Cargo.toml +++ b/cosmic-comp-config/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2024" [dependencies] -cosmic-config = { git = "https://github.com/pop-os/libcosmic/" } +cosmic-config = { git = "https://github.com/pop-os/libcosmic", branch = "iced-rebase" } cosmic-randr-shell = { git = "https://github.com/pop-os/cosmic-randr/", optional = true } input = "0.9.1" libdisplay-info = { version = "0.3.0", optional = true } diff --git a/src/shell/element/resize_indicator.rs b/src/shell/element/resize_indicator.rs index 84e1ba0d3..49dc4781c 100644 --- a/src/shell/element/resize_indicator.rs +++ b/src/shell/element/resize_indicator.rs @@ -12,7 +12,7 @@ use cosmic::{ Apply, iced::{ Alignment, - widget::{column, container, horizontal_space, row, vertical_space}, + widget::{column, container, row, space}, }, iced_core::{Background, Border, Color, Length}, theme, @@ -70,6 +70,7 @@ impl Program for ResizeIndicatorInternal { let edges = self.edges.lock().unwrap(); let icon_container_style = || { theme::Container::custom(|theme| container::Style { + snap: true, icon_color: Some(Color::from(theme.cosmic().accent.on)), text_color: Some(Color::from(theme.cosmic().accent.on)), background: Some(Background::Color(theme.cosmic().accent_color().into())), @@ -99,7 +100,7 @@ impl Program for ResizeIndicatorInternal { .center_x(Length::Fill) .into() } else { - vertical_space().height(36).into() + space::vertical().height(36).into() }, row(vec![ if edges.contains(ResizeEdge::LEFT) { @@ -118,12 +119,12 @@ impl Program for ResizeIndicatorInternal { .center_y(Length::Fill) .into() } else { - horizontal_space().width(36).into() + space::horizontal().width(36).into() }, row(vec![ text::heading(&self.shortcut1).into(), text::body(fl!("grow-window")).into(), - horizontal_space().width(40).into(), + space::horizontal().width(40).into(), text::heading(&self.shortcut2).into(), text::body(fl!("shrink-window")).into(), ]) @@ -155,7 +156,7 @@ impl Program for ResizeIndicatorInternal { .center_y(Length::Fill) .into() } else { - horizontal_space().width(36).into() + space::horizontal().width(36).into() }, ]) .width(Length::Fill) @@ -177,7 +178,7 @@ impl Program for ResizeIndicatorInternal { .center_x(Length::Fill) .into() } else { - vertical_space().height(36).into() + space::vertical().height(36).into() }, ]) .into() diff --git a/src/shell/element/stack.rs b/src/shell/element/stack.rs index 56e878f8c..3b8250e46 100644 --- a/src/shell/element/stack.rs +++ b/src/shell/element/stack.rs @@ -1303,7 +1303,7 @@ impl Decorations for DefaultDecorations { .height(Length::Fill) .width(Length::Fill), ), - iced_widget::horizontal_space() + iced_widget::space::horizontal() .width(Length::Fixed(0.0)) .apply(iced_widget::container) .padding([64, 24]) @@ -1345,6 +1345,7 @@ impl Decorations for DefaultDecorations { }; iced_widget::container::Style { +snap: true, icon_color: Some(cosmic_theme.background.on.into()), text_color: Some(cosmic_theme.background.on.into()), background: Some(Background::Color(background.into())), diff --git a/src/shell/element/stack/tab.rs b/src/shell/element/stack/tab.rs index f8f3869d7..c8a6a5287 100644 --- a/src/shell/element/stack/tab.rs +++ b/src/shell/element/stack/tab.rs @@ -30,19 +30,19 @@ impl From for theme::Rule { match theme { TabRuleTheme::ActiveActivated => Self::custom(|theme| widget::rule::Style { color: theme.cosmic().accent_color().into(), - width: 4, + snap: true, radius: 0.0.into(), fill_mode: FillMode::Full, }), TabRuleTheme::ActiveDeactivated => Self::custom(|theme| widget::rule::Style { color: theme.cosmic().palette.neutral_5.into(), - width: 4, + snap: true, radius: 0.0.into(), fill_mode: FillMode::Full, }), TabRuleTheme::Default => Self::custom(|theme| widget::rule::Style { color: theme.cosmic().palette.neutral_5.into(), - width: 4, + snap: true, radius: 8.0.into(), fill_mode: FillMode::Padded(4), }), @@ -62,6 +62,7 @@ impl From for theme::Container<'_> { match background_theme { TabBackgroundTheme::ActiveActivated => { Self::custom(move |theme| widget::container::Style { + snap: true, icon_color: Some(Color::from(theme.cosmic().accent_text_color())), text_color: Some(Color::from(theme.cosmic().accent_text_color())), background: Some(Background::Color( @@ -77,6 +78,7 @@ impl From for theme::Container<'_> { } TabBackgroundTheme::ActiveDeactivated => { Self::custom(move |theme| widget::container::Style { + snap: true, icon_color: None, text_color: None, background: Some(Background::Color( @@ -186,7 +188,7 @@ impl Tab { } let items = vec![ - widget::vertical_rule(4).class(self.rule_theme).into(), + widget::rule::vertical(4).class(self.rule_theme).into(), self.app_icon .clone() .apply(widget::container) @@ -262,7 +264,7 @@ where Size::new(Length::Fill, Length::Fill) } - fn layout(&self, tree: &mut Tree, renderer: &cosmic::Renderer, limits: &Limits) -> Node { + fn layout(&mut self, tree: &mut Tree, renderer: &cosmic::Renderer, limits: &Limits) -> Node { let min_size = Size { height: TAB_HEIGHT as f32, width: if self.active { @@ -295,74 +297,68 @@ where 8., cosmic::iced::Alignment::Center, if size.width >= CLOSE_BREAKPOINT as f32 { - &self.elements + &mut self.elements } else if size.width >= TEXT_BREAKPOINT as f32 { - &self.elements[0..3] + &mut self.elements[0..3] } else { - &self.elements[0..2] + &mut self.elements[0..2] }, &mut tree.children, ) } fn operate( - &self, + &mut self, tree: &mut Tree, layout: Layout<'_>, renderer: &cosmic::Renderer, operation: &mut dyn Operation<()>, ) { - operation.container(None, layout.bounds(), &mut |operation| { + operation.container(None, layout.bounds()); + operation.traverse(&mut |operation| { self.elements - .iter() + .iter_mut() .zip(&mut tree.children) .zip(layout.children()) .for_each(|((child, state), layout)| { child - .as_widget() + .as_widget_mut() .operate(state, layout, renderer, operation); }); }); } - fn on_event( + fn update( &mut self, tree: &mut Tree, - event: event::Event, + event: &event::Event, layout: Layout<'_>, cursor: mouse::Cursor, renderer: &cosmic::Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, viewport: &Rectangle, - ) -> event::Status { + ) { let status = self .elements .iter_mut() .zip(&mut tree.children) .zip(layout.children()) .map(|((child, state), layout)| { - child.as_widget_mut().on_event( - state, - event.clone(), - layout, - cursor, - renderer, - clipboard, - shell, - viewport, + child.as_widget_mut().update( + state, event, layout, cursor, renderer, clipboard, shell, viewport, ) - }) - .fold(event::Status::Ignored, event::Status::merge); + }); - if status == event::Status::Ignored && cursor.is_over(layout.bounds()) { + if !shell.is_event_captured() && cursor.is_over(layout.bounds()) { if matches!( event, event::Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) ) { if let Some(message) = self.press_message.clone() { shell.publish(message); - return event::Status::Captured; + shell.capture_event(); + return; } } if matches!( @@ -371,7 +367,8 @@ where ) { if let Some(message) = self.right_click_message.clone() { shell.publish(message); - return event::Status::Captured; + shell.capture_event(); + return; } } if matches!( @@ -379,11 +376,10 @@ where event::Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left)) ) { shell.publish(Message::activate(self.idx)); - return event::Status::Captured; + shell.capture_event(); + return; } } - - status } fn mouse_interaction( @@ -447,10 +443,18 @@ where fn overlay<'b>( &'b mut self, tree: &'b mut Tree, - layout: Layout<'_>, + layout: Layout<'b>, renderer: &cosmic::Renderer, + viewport: &Rectangle, translation: cosmic::iced::Vector, ) -> Option> { - overlay::from_children(&mut self.elements, tree, layout, renderer, translation) + overlay::from_children( + &mut self.elements, + tree, + layout, + renderer, + viewport, + translation, + ) } } diff --git a/src/shell/element/stack/tab_text.rs b/src/shell/element/stack/tab_text.rs index 93b90d14a..042a658d6 100644 --- a/src/shell/element/stack/tab_text.rs +++ b/src/shell/element/stack/tab_text.rs @@ -78,10 +78,10 @@ impl TabText { ::Paragraph::with_text(Text { content: &self.text, size: cosmic::iced_core::Pixels(self.font_size), - bounds: Size::INFINITY, + bounds: Size::INFINITE, font: self.font, - horizontal_alignment: alignment::Horizontal::Left, - vertical_alignment: alignment::Vertical::Center, + align_x: cosmic::iced_core::text::Alignment::Left, + align_y: alignment::Vertical::Center, shaping: Shaping::Advanced, line_height: LineHeight::default(), wrapping: Wrapping::None, @@ -107,7 +107,7 @@ impl Widget for TabText { Size::new(self.width, self.height) } - fn layout(&self, tree: &mut Tree, _renderer: &cosmic::Renderer, limits: &Limits) -> Node { + fn layout(&mut self, tree: &mut Tree, _renderer: &cosmic::Renderer, limits: &Limits) -> Node { let state = tree.state.downcast_mut::(); let text_bounds = state.paragraph.min_bounds(); state.overflowed = limits.max().width < text_bounds.width; @@ -166,6 +166,7 @@ impl Widget for TabText { renderer.fill_quad( renderer::Quad { + snap: true, bounds: Rectangle { x: (bounds.x + bounds.width - 24.).max(bounds.x), width: 24.0_f32.min(bounds.width), diff --git a/src/shell/element/stack/tabs.rs b/src/shell/element/stack/tabs.rs index fe084b555..ef241d883 100644 --- a/src/shell/element/stack/tabs.rs +++ b/src/shell/element/stack/tabs.rs @@ -1,3 +1,5 @@ +use crate::backend::render::element; + use super::tab::{MIN_ACTIVE_TAB_WIDTH, Tab, TabBackgroundTheme, TabMessage, TabRuleTheme}; use cosmic::{ Apply, @@ -64,12 +66,12 @@ pub struct State { } impl Scrollable for State { - fn snap_to(&mut self, offset: RelativeOffset) { - self.offset_x = Offset::Relative(offset.x.clamp(0.0, 1.0)); + fn snap_to(&mut self, offset: RelativeOffset>) { + self.offset_x = Offset::Relative(offset.x.unwrap_or(0.0).clamp(0.0, 1.0)); } - fn scroll_to(&mut self, offset: AbsoluteOffset) { - let new_offset = Offset::Absolute(offset.x.max(0.0)); + fn scroll_to(&mut self, offset: AbsoluteOffset>) { + let new_offset = Offset::Absolute(offset.x.unwrap_or(0.0).max(0.0)); self.scroll_animation = Some(ScrollAnimationState { start_time: Instant::now(), start: self.offset_x, @@ -159,7 +161,7 @@ where Element::new(tab.internal(i)) }); - let tabs_rule = widget::vertical_rule(4).class(if tabs.len() - 1 == active { + let tabs_rule = widget::rule::vertical(4).class(if tabs.len() - 1 == active { if activated { TabRuleTheme::ActiveActivated } else { @@ -193,12 +195,12 @@ where let mut elements = Vec::with_capacity(tabs.len() + 5); - elements.push(widget::vertical_rule(4).class(rule_style).into()); + elements.push(widget::rule::vertical(4).class(rule_style).into()); elements.push(prev_button.into()); elements.extend(tabs); elements.push(tabs_rule.into()); elements.push(next_button.into()); - elements.push(widget::vertical_rule(4).class(rule_style).into()); + elements.push(widget::rule::vertical(4).class(rule_style).into()); Tabs { elements, @@ -340,9 +342,9 @@ where } #[allow(clippy::too_many_lines)] - fn layout(&self, tree: &mut Tree, renderer: &cosmic::Renderer, limits: &Limits) -> Node { + fn layout(&mut self, tree: &mut Tree, renderer: &cosmic::Renderer, limits: &Limits) -> Node { let limits = limits.width(self.width).height(self.height); - + let element_count = self.elements.len(); // calculate the smallest possible size let child_limits = Limits::new( Size::new(0.0, limits.min().height), @@ -351,10 +353,13 @@ where .width(Length::Shrink) .height(Length::Shrink); - let mut nodes = self.elements[2..self.elements.len() - 2] - .iter() + let mut nodes = self.elements[2..element_count - 2] + .iter_mut() .zip(tree.children.iter_mut().skip(2)) - .map(|(tab, tab_tree)| tab.as_widget().layout(tab_tree, renderer, &child_limits)) + .map(|(tab, tab_tree)| { + tab.as_widget_mut() + .layout(tab_tree, renderer, &child_limits) + }) .collect::>(); // sum up @@ -370,8 +375,9 @@ where if min_size.width <= size.width { // we don't need to scroll + let element_count = self.elements.len(); // can we make every tab equal weight and keep the active large enough? - let children = if (size.width / (self.elements.len() as f32 - 5.)).ceil() as i32 + let children = if (size.width / (element_count as f32 - 5.)).ceil() as i32 >= MIN_ACTIVE_TAB_WIDTH { // just use a flex layout @@ -384,20 +390,20 @@ where 0.into(), 0., cosmic::iced::Alignment::Center, - &self.elements[2..self.elements.len() - 2], - &mut tree.children[2..self.elements.len() - 2], + &mut self.elements[2..element_count - 2], + &mut tree.children[2..element_count - 2], ) .children() .to_vec() } else { // otherwise we need a more manual approach - let min_width = (size.width - MIN_ACTIVE_TAB_WIDTH as f32 - 4.) - / (self.elements.len() as f32 - 6.); + let min_width = + (size.width - MIN_ACTIVE_TAB_WIDTH as f32 - 4.) / (element_count as f32 - 6.); let mut offset = 0.; - let mut nodes = self.elements[2..self.elements.len() - 3] - .iter() - .zip(tree.children[2..].iter_mut()) + let mut nodes = self.elements[2..element_count - 3] + .iter_mut() + .zip(tree.children[2..element_count - 3].iter_mut()) .map(|(tab, tab_tree)| { let child_limits = Limits::new( Size::new(min_width, limits.min().height), @@ -406,7 +412,9 @@ where .width(Length::Shrink) .height(Length::Shrink); - let mut node = tab.as_widget().layout(tab_tree, renderer, &child_limits); + let mut node = + tab.as_widget_mut() + .layout(tab_tree, renderer, &child_limits); node = node.move_to(Point::new(offset, 0.)); offset += node.bounds().width; node @@ -508,6 +516,7 @@ where let background_style = Catalog::style( theme, &theme::Container::custom(|theme| widget::container::Style { + snap: true, icon_color: None, text_color: None, background: Some(Background::Color( @@ -605,6 +614,9 @@ where let cursor = match cursor { mouse::Cursor::Available(point) => mouse::Cursor::Available(point + offset), mouse::Cursor::Unavailable => mouse::Cursor::Unavailable, + mouse::Cursor::Levitating(point) => { + mouse::Cursor::Levitating(point + offset) + } }; renderer.with_layer(bounds, |renderer| { @@ -677,7 +689,7 @@ where } fn operate( - &self, + &mut self, tree: &mut Tree, layout: Layout<'_>, renderer: &cosmic::Renderer, @@ -691,38 +703,38 @@ where state.cleanup_old_animations(); operation.scrollable( - state, self.id.as_ref(), bounds, content_bounds, - Vector { x: 0.0, y: 0.0 }, /* seemingly unused */ + Vector { x: 0.0, y: 0.0 }, + state, ); - - operation.container(self.id.as_ref(), bounds, &mut |operation| { - self.elements[2..self.elements.len() - 3] - .iter() + let element_count = self.elements.len(); + operation.traverse(&mut |operation| { + self.elements[2..element_count - 3] + .iter_mut() .zip(tree.children.iter_mut().skip(2)) .zip(layout.children().skip(2)) .for_each(|((child, state), layout)| { child - .as_widget() + .as_widget_mut() .operate(state, layout, renderer, operation); }); }); } #[allow(clippy::too_many_lines)] - fn on_event( + fn update( &mut self, tree: &mut Tree, - event: event::Event, + event: &event::Event, layout: Layout<'_>, cursor: mouse::Cursor, renderer: &cosmic::Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, viewport: &Rectangle, - ) -> event::Status { + ) { let state = tree.state.downcast_mut::(); state.cleanup_old_animations(); @@ -849,15 +861,15 @@ where let mut internal_shell = Shell::new(&mut messages); let len = self.elements.len(); - let result = if scrolling && cursor.position().is_some_and(|pos| pos.x < bounds.x) { + if scrolling && cursor.position().is_some_and(|pos| pos.x < bounds.x) { self.elements[0..2] .iter_mut() .zip(&mut tree.children) .zip(layout.children()) .map(|((child, state), layout)| { - child.as_widget_mut().on_event( + child.as_widget_mut().update( state, - event.clone(), + event, layout, cursor, renderer, @@ -865,8 +877,7 @@ where &mut internal_shell, viewport, ) - }) - .fold(event::Status::Ignored, event::Status::merge) + }); } else if scrolling && cursor .position() @@ -877,9 +888,9 @@ where .zip(tree.children.iter_mut().skip(len - 3)) .zip(layout.children().skip(len - 3)) .map(|((child, state), layout)| { - child.as_widget_mut().on_event( + child.as_widget_mut().update( state, - event.clone(), + event, layout, cursor, renderer, @@ -887,8 +898,7 @@ where &mut internal_shell, viewport, ) - }) - .fold(event::Status::Ignored, event::Status::merge) + }); } else { self.elements[2..len - 3] .iter_mut() @@ -898,11 +908,14 @@ where let cursor = match cursor { mouse::Cursor::Available(point) => mouse::Cursor::Available(point + offset), mouse::Cursor::Unavailable => mouse::Cursor::Unavailable, + mouse::Cursor::Levitating(point) => { + mouse::Cursor::Levitating(point + offset) + } }; - child.as_widget_mut().on_event( + child.as_widget_mut().update( state, - event.clone(), + event, layout, cursor, renderer, @@ -910,8 +923,7 @@ where &mut internal_shell, viewport, ) - }) - .fold(event::Status::Ignored, event::Status::merge) + }); }; for mut message in messages { @@ -919,14 +931,12 @@ where x: state.offset_x.absolute(bounds.width, content_bounds.width), y: 0., }) { - state.scroll_to(offset); + state.scroll_to(offset.into()); continue; } shell.publish(message); } - - result } fn mouse_interaction( @@ -992,6 +1002,9 @@ where let cursor = match cursor { mouse::Cursor::Available(point) => mouse::Cursor::Available(point + offset), mouse::Cursor::Unavailable => mouse::Cursor::Unavailable, + mouse::Cursor::Levitating(point) => { + mouse::Cursor::Levitating(point + offset) + } }; child.as_widget().mouse_interaction( @@ -1010,10 +1023,18 @@ where fn overlay<'b>( &'b mut self, tree: &'b mut Tree, - layout: Layout<'_>, + layout: Layout<'b>, renderer: &cosmic::Renderer, + viewport: &Rectangle, translation: cosmic::iced::Vector, ) -> Option> { - overlay::from_children(&mut self.elements, tree, layout, renderer, translation) + overlay::from_children( + &mut self.elements, + tree, + layout, + renderer, + viewport, + translation, + ) } } diff --git a/src/shell/element/stack_hover.rs b/src/shell/element/stack_hover.rs index 3f58daea4..9a86709c0 100644 --- a/src/shell/element/stack_hover.rs +++ b/src/shell/element/stack_hover.rs @@ -12,7 +12,7 @@ use cosmic::{ }, iced_core::{Background, Border, Color, Length}, theme, - widget::{horizontal_space, icon::from_name, text}, + widget::{icon::from_name, space, text}, }; use smithay::utils::{Logical, Size}; @@ -38,7 +38,7 @@ impl Program for StackHoverInternal { .prefer_svg(true) .icon() .into(), - horizontal_space().width(16).into(), + space::horizontal().width(16).into(), text::title3(fl!("stack-windows")).into(), ]) .align_y(Alignment::Center) @@ -48,6 +48,7 @@ impl Program for StackHoverInternal { .padding(16) .apply(container) .class(theme::Container::custom(|theme| container::Style { + snap: true, icon_color: Some(Color::from(theme.cosmic().accent.on)), text_color: Some(Color::from(theme.cosmic().accent.on)), background: Some(Background::Color(theme.cosmic().accent_color().into())), diff --git a/src/shell/element/swap_indicator.rs b/src/shell/element/swap_indicator.rs index 9bea44ec1..0db66cda3 100644 --- a/src/shell/element/swap_indicator.rs +++ b/src/shell/element/swap_indicator.rs @@ -6,7 +6,7 @@ use crate::{ use calloop::LoopHandle; use cosmic::{ Apply, - iced::widget::{container, horizontal_space, row}, + iced::widget::{container, row, space}, iced_core::{Alignment, Background, Border, Color, Length}, theme, widget::{icon::from_name, text}, @@ -34,7 +34,7 @@ impl Program for SwapIndicatorInternal { .prefer_svg(true) .icon() .into(), - horizontal_space().width(16).into(), + space::horizontal().width(16).into(), text::title3(fl!("swap-windows")).into(), ]) .align_y(Alignment::Center) @@ -44,6 +44,7 @@ impl Program for SwapIndicatorInternal { .padding(16) .apply(container) .class(theme::Container::custom(|theme| container::Style { + snap: true, icon_color: Some(Color::from(theme.cosmic().accent.on)), text_color: Some(Color::from(theme.cosmic().accent.on)), background: Some(Background::Color(theme.cosmic().accent_color().into())), diff --git a/src/shell/grabs/menu/item.rs b/src/shell/grabs/menu/item.rs index be0b2c82b..c338f2e0e 100644 --- a/src/shell/grabs/menu/item.rs +++ b/src/shell/grabs/menu/item.rs @@ -52,13 +52,13 @@ where } fn layout( - &self, + &mut self, state: &mut Tree, renderer: &cosmic::Renderer, limits: &layout::Limits, ) -> layout::Node { let state = &mut state.children[0]; - let node = self.elem.as_widget().layout(state, renderer, limits); + let node = self.elem.as_widget_mut().layout(state, renderer, limits); layout::Node::with_children(node.size(), vec![node]) } @@ -81,6 +81,7 @@ where renderer.fill_quad( Quad { + snap: true, bounds: layout.bounds(), border: Border { radius: styling.border_radius, @@ -128,7 +129,7 @@ where } fn operate( - &self, + &mut self, state: &mut Tree, layout: Layout<'_>, renderer: &cosmic::Renderer, @@ -137,21 +138,21 @@ where let state = &mut state.children[0]; let layout = layout.children().next().unwrap(); self.elem - .as_widget() + .as_widget_mut() .operate(state, layout, renderer, operation) } - fn on_event( + fn update( &mut self, state: &mut Tree, - event: Event, + event: &Event, layout: Layout<'_>, cursor: mouse::Cursor, renderer: &cosmic::Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, viewport: &Rectangle, - ) -> event::Status { + ) { let mut bounds = layout.bounds(); // fix padding 1 and event... don't ask. @@ -180,9 +181,9 @@ where let state = &mut state.children[0]; let layout = layout.children().next().unwrap(); - self.elem.as_widget_mut().on_event( + self.elem.as_widget_mut().update( state, event, layout, cursor, renderer, clipboard, shell, viewport, - ) + ); } fn mouse_interaction( @@ -203,15 +204,16 @@ where fn overlay<'b>( &'b mut self, state: &'b mut Tree, - layout: Layout<'_>, + layout: Layout<'b>, renderer: &cosmic::Renderer, + viewport: &Rectangle, translation: cosmic::iced::Vector, ) -> Option> { let state = &mut state.children[0]; let layout = layout.children().next().unwrap(); self.elem .as_widget_mut() - .overlay(state, layout, renderer, translation) + .overlay(state, layout, renderer, viewport, translation) } } diff --git a/src/shell/grabs/menu/mod.rs b/src/shell/grabs/menu/mod.rs index 53325f81a..f2ce2b29c 100644 --- a/src/shell/grabs/menu/mod.rs +++ b/src/shell/grabs/menu/mod.rs @@ -13,7 +13,7 @@ use cosmic::{ iced_core::{Border, Length, Rectangle as IcedRectangle, alignment::Horizontal}, iced_widget::{self, Column, Row, text::Style as TextStyle}, theme, - widget::{button, divider, horizontal_space, icon::from_name, text}, + widget::{button, divider, icon::from_name, space, text}, }; use smithay::{ backend::{ @@ -392,7 +392,7 @@ impl Program for ContextMenu { match item { Item::Separator => divider::horizontal::light().into(), Item::Submenu { title, .. } => Row::with_children(vec![ - horizontal_space().width(16).into(), + space::horizontal().width(16).into(), text::body(title).width(mode).into(), from_name("go-next-symbolic") .size(16) @@ -425,7 +425,7 @@ impl Program for ContextMenu { })) .into() } else { - horizontal_space().width(16).into() + space::horizontal().width(16).into() }, text::body(title) .width(mode) @@ -441,7 +441,7 @@ impl Program for ContextMenu { theme::Text::Default }) .into(), - horizontal_space().width(16).into(), + space::horizontal().width(16).into(), ]; if let Some(shortcut) = shortcut.as_ref() { components.push( @@ -479,6 +479,7 @@ impl Program for ContextMenu { let cosmic = theme.cosmic(); let component = &cosmic.background.component; iced_widget::container::Style { + snap: true, icon_color: Some(cosmic.accent.base.into()), text_color: Some(component.on.into()), background: Some(Background::Color(component.base.into())), diff --git a/src/shell/zoom.rs b/src/shell/zoom.rs index fc018c485..f41a021a4 100644 --- a/src/shell/zoom.rs +++ b/src/shell/zoom.rs @@ -514,6 +514,7 @@ impl Program for ZoomProgram { let cosmic = theme.cosmic(); let component = &cosmic.background.component; iced_widget::container::Style { + snap: true, icon_color: Some(component.on.into()), text_color: Some(component.on.into()), background: Some(Background::Color(component.base.into())), diff --git a/src/utils/iced.rs b/src/utils/iced.rs index 43fa005f7..15d5169ac 100644 --- a/src/utils/iced.rs +++ b/src/utils/iced.rs @@ -18,11 +18,7 @@ use cosmic::{ window::Event as WindowEvent, }, iced_core::{Color, Length, Pixels, clipboard::Null as NullClipboard, id::Id, renderer::Style}, - iced_runtime::{ - Action, Debug, - program::{Program as IcedProgram, State}, - task::into_stream, - }, + iced_runtime::{Action, task::into_stream}, }; use iced_tiny_skia::{ Layer, @@ -66,6 +62,8 @@ use smithay::{ }, }; +use crate::utils::state::State; + static ID: LazyLock = LazyLock::new(|| Id::new("Program")); pub struct IcedElement(pub(crate) Arc>>); @@ -99,6 +97,26 @@ impl Hash for IcedElement

{ } } +pub trait IcedProgram { + type Message: std::fmt::Debug + Send; + fn update(&mut self, _message: Self::Message) -> Task { + Task::none() + } + fn view(&self) -> cosmic::Element<'_, Self::Message>; + + fn background_color(&self) -> Color { + Color::TRANSPARENT + } + + fn foreground( + &self, + _pixels: &mut tiny_skia::PixmapMut<'_>, + _damage: &[Rectangle], + _scale: f32, + ) { + } +} + pub trait Program { type Message: std::fmt::Debug + Send; fn update( @@ -135,8 +153,6 @@ struct ProgramWrapper { impl IcedProgram for ProgramWrapper

{ type Message =

::Message; - type Renderer = cosmic::Renderer; - type Theme = cosmic::Theme; fn update(&mut self, message: Self::Message) -> Task { let last_seat = self.last_seat.lock().unwrap(); @@ -165,7 +181,6 @@ pub(crate) struct IcedElementInternal { theme: Theme, renderer: cosmic::Renderer, state: State>, - debug: Debug, // futures handle: LoopHandle<'static, crate::state::State>, @@ -189,7 +204,6 @@ impl Clone for IcedElementInternal

{ tracing::warn!("Missing force_update call"); } let mut renderer = cosmic::Renderer::new(cosmic::font::default(), Pixels(16.0)); - let mut debug = Debug::new(); let state = State::new( ID.clone(), ProgramWrapper { @@ -199,7 +213,6 @@ impl Clone for IcedElementInternal

{ }, IcedSize::new(self.size.w as f32, self.size.h as f32), &mut renderer, - &mut debug, ); IcedElementInternal { @@ -214,7 +227,6 @@ impl Clone for IcedElementInternal

{ theme: self.theme.clone(), renderer, state, - debug, handle, scheduler, executor_token, @@ -240,7 +252,6 @@ impl fmt::Debug for IcedElementInternal

{ .field("theme", &"...") .field("renderer", &"...") .field("state", &"...") - .field("debug", &self.debug) .field("handle", &self.handle) .field("scheduler", &self.scheduler) .field("executor_token", &self.executor_token) @@ -265,7 +276,6 @@ impl IcedElement

{ let size = size.into(); let last_seat = Arc::new(Mutex::new(None)); let mut renderer = cosmic::Renderer::new(cosmic::font::default(), Pixels(16.0)); - let mut debug = Debug::new(); let state = State::new( ID.clone(), @@ -276,7 +286,6 @@ impl IcedElement

{ }, IcedSize::new(size.w as f32, size.h as f32), &mut renderer, - &mut debug, ); let (executor, scheduler) = calloop::futures::executor().expect("Out of file descriptors"); @@ -299,7 +308,6 @@ impl IcedElement

{ theme, renderer, state, - debug, handle, scheduler, executor_token, @@ -317,14 +325,16 @@ impl IcedElement

{ pub fn minimum_size(&self) -> Size { let internal = self.0.lock().unwrap(); - let element = internal.state.program().program.view(); + let mut element = internal.state.program().program.view(); + + let mut tree = Tree::new(element.as_widget()); let node = element - .as_widget() + .as_widget_mut() .layout( // TODO Avoid creating a new tree here? - &mut Tree::new(element.as_widget()), + &mut tree, &internal.renderer, - &Limits::new(IcedSize::ZERO, IcedSize::INFINITY) + &Limits::new(IcedSize::ZERO, IcedSize::INFINITE) .width(Length::Shrink) .height(Length::Shrink), ) @@ -432,7 +442,6 @@ impl IcedElementInternal

{ text_color: self.theme.cosmic().on_bg_color().into(), }, &mut NullClipboard, - &mut self.debug, ) .1; @@ -922,7 +931,6 @@ where if size.w > 0 && size.h > 0 { let state_ref = &internal_ref.state; let mut clip_mask = tiny_skia::Mask::new(size.w as u32, size.h as u32).unwrap(); - let overlay = internal_ref.debug.overlay(); let theme = &internal_ref.theme; _ = buffer.render().draw(|buf| { @@ -977,7 +985,6 @@ where &viewport, &damage, background_color, - &overlay, ); } diff --git a/src/utils/mod.rs b/src/utils/mod.rs index ac1df0194..69b32a526 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -9,4 +9,5 @@ pub mod prelude; pub mod quirks; pub mod rlimit; pub mod screenshot; +pub mod state; pub mod tween; diff --git a/src/utils/state.rs b/src/utils/state.rs new file mode 100644 index 000000000..4425fdf32 --- /dev/null +++ b/src/utils/state.rs @@ -0,0 +1,222 @@ +use super::iced::IcedProgram as Program; +use cosmic::iced::core::event::{self, Event}; +use cosmic::iced::core::mouse; +use cosmic::iced::core::renderer; +use cosmic::iced::core::widget::operation::{self, Operation}; +use cosmic::iced::core::{Clipboard, Size}; +use cosmic::iced_core; +use cosmic::iced_runtime::Task; +use cosmic::iced_runtime::user_interface::{self, UserInterface}; + +/// The execution state of a [`Program`]. It leverages caching, event +/// processing, and rendering primitive storage. +#[allow(missing_debug_implementations)] +pub struct State

+where + P: Program + 'static, +{ + program: P, + cache: Option, + queued_events: Vec, + queued_messages: Vec, + mouse_interaction: mouse::Interaction, +} + +impl

State

+where + P: Program + 'static, +{ + /// Creates a new [`State`] with the provided [`Program`], initializing its + /// primitive with the given logical bounds and renderer. + pub fn new( + id: iced_core::id::Id, + mut program: P, + bounds: Size, + renderer: &mut cosmic::Renderer, + ) -> Self { + let user_interface = build_user_interface( + id, + &mut program, + user_interface::Cache::default(), + renderer, + bounds, + ); + + let cache = Some(user_interface.into_cache()); + + State { + program, + cache, + queued_events: Vec::new(), + queued_messages: Vec::new(), + mouse_interaction: mouse::Interaction::None, + } + } + + /// Returns a reference to the [`Program`] of the [`State`]. + pub fn program(&self) -> &P { + &self.program + } + + /// Queues an event in the [`State`] for processing during an [`update`]. + /// + /// [`update`]: Self::update + pub fn queue_event(&mut self, event: Event) { + self.queued_events.push(event); + } + + /// Queues a message in the [`State`] for processing during an [`update`]. + /// + /// [`update`]: Self::update + pub fn queue_message(&mut self, message: P::Message) { + self.queued_messages.push(message); + } + + /// Returns whether the event queue of the [`State`] is empty or not. + pub fn is_queue_empty(&self) -> bool { + self.queued_events.is_empty() && self.queued_messages.is_empty() + } + + /// Returns the current [`mouse::Interaction`] of the [`State`]. + pub fn mouse_interaction(&self) -> mouse::Interaction { + self.mouse_interaction + } + + /// Processes all the queued events and messages, rebuilding and redrawing + /// the widgets of the linked [`Program`] if necessary. + /// + /// Returns a list containing the instances of [`Event`] that were not + /// captured by any widget, and the [`Task`] obtained from [`Program`] + /// after updating it, only if an update was necessary. + pub fn update( + &mut self, + id: iced_core::id::Id, + bounds: Size, + cursor: mouse::Cursor, + renderer: &mut cosmic::Renderer, + theme: &cosmic::Theme, + style: &renderer::Style, + clipboard: &mut dyn Clipboard, + ) -> (Vec, Option>) { + let mut user_interface = build_user_interface( + id.clone(), + &mut self.program, + self.cache.take().unwrap(), + renderer, + bounds, + ); + + let mut messages = Vec::new(); + + let (state, event_statuses) = user_interface.update( + &self.queued_events, + cursor, + renderer, + clipboard, + &mut messages, + ); + + let uncaptured_events = self + .queued_events + .iter() + .zip(event_statuses) + .filter_map(|(event, status)| matches!(status, event::Status::Ignored).then_some(event)) + .cloned() + .collect(); + + self.queued_events.clear(); + messages.append(&mut self.queued_messages); + + let task = if messages.is_empty() { + if let cosmic::iced_runtime::user_interface::State::Updated { + mouse_interaction, .. + } = state + { + self.mouse_interaction = mouse_interaction; + } + + user_interface.draw(renderer, theme, style, cursor); + + self.cache = Some(user_interface.into_cache()); + + None + } else { + // When there are messages, we are forced to rebuild twice + // for now :^) + let temp_cache = user_interface.into_cache(); + + let tasks = Task::batch(messages.into_iter().map(|message| { + let task = self.program.update(message); + + task + })); + + let mut user_interface = + build_user_interface(id, &mut self.program, temp_cache, renderer, bounds); + + if let cosmic::iced_runtime::user_interface::State::Updated { + mouse_interaction, .. + } = state + { + self.mouse_interaction = mouse_interaction; + } + + user_interface.draw(renderer, theme, style, cursor); + + self.cache = Some(user_interface.into_cache()); + + Some(tasks) + }; + + (uncaptured_events, task) + } + + /// Applies [`Operation`]s to the [`State`] + pub fn operate( + &mut self, + id: iced_core::id::Id, + renderer: &mut cosmic::Renderer, + operations: impl Iterator>, + bounds: Size, + ) { + let mut user_interface = build_user_interface( + id, + &mut self.program, + self.cache.take().unwrap(), + renderer, + bounds, + ); + + for operation in operations { + let mut current_operation = Some(operation); + + while let Some(mut operation) = current_operation.take() { + user_interface.operate(renderer, operation.as_mut()); + + match operation.finish() { + operation::Outcome::None => {} + operation::Outcome::Some(()) => {} + operation::Outcome::Chain(next) => { + current_operation = Some(next); + } + }; + } + } + + self.cache = Some(user_interface.into_cache()); + } +} + +fn build_user_interface<'a, P: Program>( + _id: iced_core::id::Id, + program: &'a mut P, + cache: user_interface::Cache, + renderer: &mut cosmic::Renderer, + size: Size, +) -> UserInterface<'a, P::Message, cosmic::Theme, cosmic::Renderer> { + let view = program.view(); + + let user_interface = UserInterface::build(view, size, cache, renderer); + + user_interface +} From d3a477b3e5d30b145e6addca6fd36f2c66d263e4 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 24 Feb 2026 15:23:20 -0500 Subject: [PATCH 2/9] wip: cosmic-randr-shell empty serial number for now --- cosmic-comp-config/Cargo.toml | 2 +- cosmic-comp-config/src/output/randr.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cosmic-comp-config/Cargo.toml b/cosmic-comp-config/Cargo.toml index a964efa3c..219ff4d1e 100644 --- a/cosmic-comp-config/Cargo.toml +++ b/cosmic-comp-config/Cargo.toml @@ -16,6 +16,6 @@ tracing = { version = "0.1.44", features = [ ], optional = true } [features] -default = [] +default = ["output", "randr"] output = ["ron", "tracing"] randr = ["cosmic-randr-shell", "output"] diff --git a/cosmic-comp-config/src/output/randr.rs b/cosmic-comp-config/src/output/randr.rs index dd6cb6c60..ac0aa0b7e 100644 --- a/cosmic-comp-config/src/output/randr.rs +++ b/cosmic-comp-config/src/output/randr.rs @@ -74,6 +74,7 @@ impl From for cosmic_randr_shell::List { // XXX no physical output size in the config physical: (0, 0), adaptive_sync_availability: None, + serial_number: String::new(), }); } From 5753ade464bfcc7795f08f8eb6011afe66c5e831 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 2 Mar 2026 15:42:04 -0500 Subject: [PATCH 3/9] fix: text position in stack --- Cargo.lock | 114 +++++++++++++++++++--------- src/shell/element/stack/tab_text.rs | 5 +- 2 files changed, 81 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 585adde39..07d71f81e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -642,10 +642,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" dependencies = [ "iana-time-zone", - "js-sys", "num-traits", "serde", - "wasm-bindgen", "windows-link", ] @@ -667,7 +665,7 @@ dependencies = [ [[package]] name = "clipboard_macos" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#3a7af79e54db6854d8aa9d9e2866a9288d0f95d5" dependencies = [ "objc", "objc-foundation", @@ -677,7 +675,7 @@ dependencies = [ [[package]] name = "clipboard_wayland" version = "0.2.2" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#3a7af79e54db6854d8aa9d9e2866a9288d0f95d5" dependencies = [ "dnd", "mime 0.1.0", @@ -687,7 +685,7 @@ dependencies = [ [[package]] name = "clipboard_x11" version = "0.4.2" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#3a7af79e54db6854d8aa9d9e2866a9288d0f95d5" dependencies = [ "thiserror 1.0.69", "x11rb", @@ -729,7 +727,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" dependencies = [ - "unicode-width 0.2.2", + "unicode-width", ] [[package]] @@ -757,6 +755,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "configparser" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57e3272f0190c3f1584272d613719ba5fc7df7f4942fe542e63d949cf3a649b" + [[package]] name = "core-foundation" version = "0.9.4" @@ -897,7 +901,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "atomicwrites", "calloop 0.14.4", @@ -918,7 +922,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "quote", "syn", @@ -996,7 +1000,7 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.18.2" -source = "git+https://github.com/pop-os/cosmic-text.git#f31b9d86959676d97fde54ff5907a58ab4308897" +source = "git+https://github.com/pop-os/cosmic-text.git#29034e56b47b7e259f9a18a01fcda8ff267fc2d1" dependencies = [ "bitflags 2.11.0", "fontdb", @@ -1019,9 +1023,10 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "almost", + "configparser", "cosmic-config", "csscolorparser", "dirs", @@ -1074,7 +1079,7 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "cryoglyph" version = "0.1.0" -source = "git+https://github.com/pop-os/glyphon.git?branch=iced-0.14#c49de15bce4d8254ac136d1be9911960cc85ce12" +source = "git+https://github.com/pop-os/glyphon.git?tag=cosmic-0.14#c49de15bce4d8254ac136d1be9911960cc85ce12" dependencies = [ "cosmic-text", "etagere", @@ -1258,12 +1263,12 @@ dependencies = [ [[package]] name = "dnd" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#3a7af79e54db6854d8aa9d9e2866a9288d0f95d5" dependencies = [ "bitflags 2.11.0", "mime 0.1.0", "raw-window-handle", - "smithay-client-toolkit 0.19.2", + "smithay-client-toolkit 0.20.0", "smithay-clipboard", ] @@ -2254,7 +2259,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "dnd", "iced_core", @@ -2273,7 +2278,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "bitflags 2.11.0", "bytes", @@ -2296,7 +2301,7 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "iced_core", "iced_futures", @@ -2306,7 +2311,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "futures", "iced_core", @@ -2319,7 +2324,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "bitflags 2.11.0", "bytemuck", @@ -2340,7 +2345,7 @@ dependencies = [ [[package]] name = "iced_program" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "iced_graphics", "iced_runtime", @@ -2349,7 +2354,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2361,7 +2366,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "bytes", "dnd", @@ -2375,7 +2380,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "bytemuck", "cosmic-text", @@ -2392,7 +2397,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "as-raw-xcb-connection", "bitflags 2.11.0", @@ -2423,7 +2428,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.2" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "dnd", "iced_renderer", @@ -2694,6 +2699,47 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" +[[package]] +name = "jiff" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819b44bc7c87d9117eb522f14d46e918add69ff12713c475946b0a29363ed1c2" +dependencies = [ + "jiff-static", + "jiff-tzdb-platform", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", + "windows-sys 0.61.2", +] + +[[package]] +name = "jiff-static" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "470252db18ecc35fd766c0891b1e3ec6cbbcd62507e85276c01bf75d8e94d4a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "jiff-tzdb" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68971ebff725b9e2ca27a601c5eb38a4c5d64422c4cbab0c535f248087eda5c2" + +[[package]] +name = "jiff-tzdb-platform" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" +dependencies = [ + "jiff-tzdb", +] + [[package]] name = "jni" version = "0.21.1" @@ -2852,11 +2898,10 @@ checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "libcosmic" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#b945da4fed7b305d1cfb5c600f50f9398bc07e44" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" dependencies = [ "apply", "auto_enums", - "chrono", "cosmic-config", "cosmic-freedesktop-icons", "cosmic-settings-daemon", @@ -2875,6 +2920,7 @@ dependencies = [ "iced_tiny_skia", "iced_widget", "image", + "jiff", "log", "palette", "phf 0.13.1", @@ -3199,13 +3245,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "cfg-if", - "unicode-width 0.1.14", + "unicode-width", ] [[package]] name = "mime" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#3a7af79e54db6854d8aa9d9e2866a9288d0f95d5" dependencies = [ "smithay-clipboard", ] @@ -5005,11 +5051,11 @@ dependencies = [ [[package]] name = "smithay-clipboard" version = "0.8.0" -source = "git+https://github.com/pop-os/smithay-clipboard?tag=pop-dnd-5#5a3007def49eb678d1144850c9ee04b80707c56a" +source = "git+https://github.com/pop-os/smithay-clipboard?tag=sctk-0.20#859b02c88f45c554049a67c6ddeec1692ce0e20b" dependencies = [ "libc", "raw-window-handle", - "smithay-client-toolkit 0.19.2", + "smithay-client-toolkit 0.20.0", "wayland-backend", ] @@ -5678,12 +5724,6 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" -[[package]] -name = "unicode-width" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" - [[package]] name = "unicode-xid" version = "0.2.6" @@ -6266,7 +6306,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" version = "0.4.1" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" +source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#3a7af79e54db6854d8aa9d9e2866a9288d0f95d5" dependencies = [ "clipboard-win", "clipboard_macos", diff --git a/src/shell/element/stack/tab_text.rs b/src/shell/element/stack/tab_text.rs index 042a658d6..7a1756418 100644 --- a/src/shell/element/stack/tab_text.rs +++ b/src/shell/element/stack/tab_text.rs @@ -142,7 +142,10 @@ impl Widget for TabText { renderer.with_layer(bounds, |renderer| { renderer.fill_paragraph( &state.paragraph, - Point::new(bounds.x, bounds.y + bounds.height / 2.0), + Point::new( + bounds.x, + bounds.y + bounds.height / 2.0 - state.paragraph.min_bounds().height / 2.0, + ), style.text_color, bounds, ); From 62197d086c0512edd1d9ebe75728a3d2ece9a303 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 4 Mar 2026 10:46:51 -0500 Subject: [PATCH 4/9] fix: iced widget event handling --- Cargo.lock | 30 +++++------ src/shell/element/stack.rs | 2 +- src/shell/element/stack/tab.rs | 12 ++--- src/shell/element/stack/tabs.rs | 92 ++++++++++++++++----------------- src/shell/grabs/menu/item.rs | 2 +- 5 files changed, 67 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07d71f81e..6d1cade55 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -901,7 +901,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "atomicwrites", "calloop 0.14.4", @@ -922,7 +922,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "quote", "syn", @@ -1023,7 +1023,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "almost", "configparser", @@ -2259,7 +2259,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "dnd", "iced_core", @@ -2278,7 +2278,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "bitflags 2.11.0", "bytes", @@ -2301,7 +2301,7 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "iced_core", "iced_futures", @@ -2311,7 +2311,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "futures", "iced_core", @@ -2324,7 +2324,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "bitflags 2.11.0", "bytemuck", @@ -2345,7 +2345,7 @@ dependencies = [ [[package]] name = "iced_program" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "iced_graphics", "iced_runtime", @@ -2354,7 +2354,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2366,7 +2366,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "bytes", "dnd", @@ -2380,7 +2380,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "bytemuck", "cosmic-text", @@ -2397,7 +2397,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "as-raw-xcb-connection", "bitflags 2.11.0", @@ -2428,7 +2428,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.2" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "dnd", "iced_renderer", @@ -2898,7 +2898,7 @@ checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "libcosmic" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#6c5b62b81f5ab687674f07d15f1412ed9c4efaf6" +source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" dependencies = [ "apply", "auto_enums", diff --git a/src/shell/element/stack.rs b/src/shell/element/stack.rs index 3b8250e46..64daf6eaa 100644 --- a/src/shell/element/stack.rs +++ b/src/shell/element/stack.rs @@ -1345,7 +1345,7 @@ impl Decorations for DefaultDecorations { }; iced_widget::container::Style { -snap: true, + snap: true, icon_color: Some(cosmic_theme.background.on.into()), text_color: Some(cosmic_theme.background.on.into()), background: Some(Background::Color(background.into())), diff --git a/src/shell/element/stack/tab.rs b/src/shell/element/stack/tab.rs index c8a6a5287..17fc52623 100644 --- a/src/shell/element/stack/tab.rs +++ b/src/shell/element/stack/tab.rs @@ -339,16 +339,16 @@ where shell: &mut Shell<'_, Message>, viewport: &Rectangle, ) { - let status = self + for ((child, state), layout) in self .elements .iter_mut() .zip(&mut tree.children) .zip(layout.children()) - .map(|((child, state), layout)| { - child.as_widget_mut().update( - state, event, layout, cursor, renderer, clipboard, shell, viewport, - ) - }); + { + child.as_widget_mut().update( + state, event, layout, cursor, renderer, clipboard, shell, viewport, + ); + } if !shell.is_event_captured() && cursor.is_over(layout.bounds()) { if matches!( diff --git a/src/shell/element/stack/tabs.rs b/src/shell/element/stack/tabs.rs index ef241d883..04c93f190 100644 --- a/src/shell/element/stack/tabs.rs +++ b/src/shell/element/stack/tabs.rs @@ -1,5 +1,3 @@ -use crate::backend::render::element; - use super::tab::{MIN_ACTIVE_TAB_WIDTH, Tab, TabBackgroundTheme, TabMessage, TabRuleTheme}; use cosmic::{ Apply, @@ -862,68 +860,66 @@ where let len = self.elements.len(); if scrolling && cursor.position().is_some_and(|pos| pos.x < bounds.x) { - self.elements[0..2] + for ((child, state), layout) in self.elements[0..2] .iter_mut() .zip(&mut tree.children) .zip(layout.children()) - .map(|((child, state), layout)| { - child.as_widget_mut().update( - state, - event, - layout, - cursor, - renderer, - clipboard, - &mut internal_shell, - viewport, - ) - }); + { + child.as_widget_mut().update( + state, + event, + layout, + cursor, + renderer, + clipboard, + &mut internal_shell, + viewport, + ); + } } else if scrolling && cursor .position() .is_some_and(|pos| pos.x >= bounds.x + bounds.width) { - self.elements[len - 3..len] + for ((child, state), layout) in self.elements[len - 3..len] .iter_mut() .zip(tree.children.iter_mut().skip(len - 3)) .zip(layout.children().skip(len - 3)) - .map(|((child, state), layout)| { - child.as_widget_mut().update( - state, - event, - layout, - cursor, - renderer, - clipboard, - &mut internal_shell, - viewport, - ) - }); + { + child.as_widget_mut().update( + state, + event, + layout, + cursor, + renderer, + clipboard, + &mut internal_shell, + viewport, + ) + } } else { - self.elements[2..len - 3] + for ((child, state), layout) in self.elements[2..len - 3] .iter_mut() .zip(tree.children.iter_mut().skip(2)) .zip(layout.children().skip(2)) - .map(|((child, state), layout)| { - let cursor = match cursor { - mouse::Cursor::Available(point) => mouse::Cursor::Available(point + offset), - mouse::Cursor::Unavailable => mouse::Cursor::Unavailable, - mouse::Cursor::Levitating(point) => { - mouse::Cursor::Levitating(point + offset) - } - }; + { + let cursor = match cursor { + mouse::Cursor::Available(point) => mouse::Cursor::Available(point + offset), + mouse::Cursor::Unavailable => mouse::Cursor::Unavailable, + mouse::Cursor::Levitating(point) => mouse::Cursor::Levitating(point + offset), + }; - child.as_widget_mut().update( - state, - event, - layout, - cursor, - renderer, - clipboard, - &mut internal_shell, - viewport, - ) - }); + child.as_widget_mut().update( + state, + event, + layout, + cursor, + renderer, + clipboard, + &mut internal_shell, + viewport, + ) + } }; for mut message in messages { diff --git a/src/shell/grabs/menu/item.rs b/src/shell/grabs/menu/item.rs index c338f2e0e..baa61fdea 100644 --- a/src/shell/grabs/menu/item.rs +++ b/src/shell/grabs/menu/item.rs @@ -2,7 +2,7 @@ use cosmic::{ iced::Element, iced_core::{ Background, Border, Clipboard, Color, Event, Layout, Length, Rectangle, - Renderer as IcedRenderer, Shell, Size, event, layout, mouse, overlay, + Renderer as IcedRenderer, Shell, Size, layout, mouse, overlay, renderer::{Quad, Style}, widget::{Id, Tree, Widget, tree}, }, From 6cf0bf6228934803f41146ae341e32634bd572ec Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 4 Mar 2026 19:15:34 -0500 Subject: [PATCH 5/9] chore: update deps --- Cargo.lock | 34 +++++++++++++++++----------------- Cargo.toml | 16 ++++++---------- cosmic-comp-config/Cargo.toml | 4 ++-- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d1cade55..8a6c0a277 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -901,7 +901,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "atomicwrites", "calloop 0.14.4", @@ -922,7 +922,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "quote", "syn", @@ -969,7 +969,7 @@ dependencies = [ [[package]] name = "cosmic-settings-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-settings-daemon?branch=iced-rebase#4e98c993f7284e5f565fdd1385c51f9ce1084d91" +source = "git+https://github.com/pop-os/cosmic-settings-daemon#e37160f14d1e7ee428f973cd2848b4e95f83dfe1" dependencies = [ "cosmic-config", "ron 0.11.0", @@ -990,7 +990,7 @@ dependencies = [ [[package]] name = "cosmic-settings-daemon-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-settings-daemon?branch=iced-rebase#4e98c993f7284e5f565fdd1385c51f9ce1084d91" +source = "git+https://github.com/pop-os/cosmic-settings-daemon#e37160f14d1e7ee428f973cd2848b4e95f83dfe1" dependencies = [ "cosmic-config", "cosmic-theme", @@ -1023,7 +1023,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "almost", "configparser", @@ -2259,7 +2259,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "dnd", "iced_core", @@ -2278,7 +2278,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "bitflags 2.11.0", "bytes", @@ -2301,7 +2301,7 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "iced_core", "iced_futures", @@ -2311,7 +2311,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "futures", "iced_core", @@ -2324,7 +2324,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "bitflags 2.11.0", "bytemuck", @@ -2345,7 +2345,7 @@ dependencies = [ [[package]] name = "iced_program" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "iced_graphics", "iced_runtime", @@ -2354,7 +2354,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2366,7 +2366,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "bytes", "dnd", @@ -2380,7 +2380,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "bytemuck", "cosmic-text", @@ -2397,7 +2397,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "as-raw-xcb-connection", "bitflags 2.11.0", @@ -2428,7 +2428,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.2" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "dnd", "iced_renderer", @@ -2898,7 +2898,7 @@ checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "libcosmic" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic/?branch=iced-rebase#ed42aef19cf422708a3bfe54582e18537be27f7d" +source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" dependencies = [ "apply", "auto_enums", diff --git a/Cargo.toml b/Cargo.toml index 1142eebfe..b0cb26561 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,21 +17,17 @@ cosmic-comp-config = { path = "cosmic-comp-config", features = [ "libdisplay-info", "output", ] } -cosmic-config = { git = "https://github.com/pop-os/libcosmic/", features = [ +cosmic-config = { git = "https://github.com/pop-os/libcosmic", features = [ "calloop", "macro", -], branch = "iced-rebase" } +] } cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", rev = "160b086", default-features = false, features = [ "server", ] } -cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon", branch = "iced-rebase" } +cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon" } cosmic-settings-daemon-config = { git = "https://github.com/pop-os/cosmic-settings-daemon", features = [ "greeter", -], branch = "iced-rebase" } -# cosmic-settings-config = { path = "../cosmic-settings-daemon/config" } -# cosmic-settings-daemon-config = { path = "../cosmic-settings-daemon/cosmic-settings-daemon-config", features = [ -# "greeter", -# ] } +] } cosmic-text = { git = "https://github.com/pop-os/cosmic-text.git", features = [ "shape-run-cache", ] } @@ -43,11 +39,11 @@ i18n-embed = { version = "0.16", features = [ "desktop-requester", ] } i18n-embed-fl = "0.10" -iced_tiny_skia = { git = "https://github.com/pop-os/libcosmic", branch = "iced-rebase" } +iced_tiny_skia = { git = "https://github.com/pop-os/libcosmic" } indexmap = "2.13" keyframe = "1.1.1" libc = "0.2.182" -libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, branch = "iced-rebase" } +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } libsystemd = { version = "0.7", optional = true } log-panics = { version = "2", features = ["with-backtrace"] } ordered-float = "5.1" diff --git a/cosmic-comp-config/Cargo.toml b/cosmic-comp-config/Cargo.toml index 219ff4d1e..66cdbfff7 100644 --- a/cosmic-comp-config/Cargo.toml +++ b/cosmic-comp-config/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2024" [dependencies] -cosmic-config = { git = "https://github.com/pop-os/libcosmic", branch = "iced-rebase" } +cosmic-config = { git = "https://github.com/pop-os/libcosmic/" } cosmic-randr-shell = { git = "https://github.com/pop-os/cosmic-randr/", optional = true } input = "0.9.1" libdisplay-info = { version = "0.3.0", optional = true } @@ -16,6 +16,6 @@ tracing = { version = "0.1.44", features = [ ], optional = true } [features] -default = ["output", "randr"] +default = [] output = ["ron", "tracing"] randr = ["cosmic-randr-shell", "output"] From 0ff755c1fb87fda6c7054dbb6af08a9fad0d76fc Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 9 Mar 2026 14:05:54 -0400 Subject: [PATCH 6/9] chore: refactor iced utils into shared module --- Cargo.lock | 32 +++++++++++++++--------------- src/utils/{iced.rs => iced/mod.rs} | 6 +++++- src/utils/{ => iced}/state.rs | 2 +- src/utils/mod.rs | 1 - 4 files changed, 22 insertions(+), 19 deletions(-) rename src/utils/{iced.rs => iced/mod.rs} (99%) rename src/utils/{ => iced}/state.rs (99%) diff --git a/Cargo.lock b/Cargo.lock index 8a6c0a277..b889ef871 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -901,7 +901,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "atomicwrites", "calloop 0.14.4", @@ -922,7 +922,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "quote", "syn", @@ -1000,7 +1000,7 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.18.2" -source = "git+https://github.com/pop-os/cosmic-text.git#29034e56b47b7e259f9a18a01fcda8ff267fc2d1" +source = "git+https://github.com/pop-os/cosmic-text.git#b6216ad123814c41c35943390727b4e7146cd143" dependencies = [ "bitflags 2.11.0", "fontdb", @@ -1023,7 +1023,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "almost", "configparser", @@ -2259,7 +2259,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "dnd", "iced_core", @@ -2278,7 +2278,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "bitflags 2.11.0", "bytes", @@ -2301,7 +2301,7 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "iced_core", "iced_futures", @@ -2311,7 +2311,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "futures", "iced_core", @@ -2324,7 +2324,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "bitflags 2.11.0", "bytemuck", @@ -2345,7 +2345,7 @@ dependencies = [ [[package]] name = "iced_program" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "iced_graphics", "iced_runtime", @@ -2354,7 +2354,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2366,7 +2366,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "bytes", "dnd", @@ -2380,7 +2380,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "bytemuck", "cosmic-text", @@ -2397,7 +2397,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "as-raw-xcb-connection", "bitflags 2.11.0", @@ -2428,7 +2428,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.2" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "dnd", "iced_renderer", @@ -2898,7 +2898,7 @@ checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "libcosmic" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a" +source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" dependencies = [ "apply", "auto_enums", diff --git a/src/utils/iced.rs b/src/utils/iced/mod.rs similarity index 99% rename from src/utils/iced.rs rename to src/utils/iced/mod.rs index 15d5169ac..4fcb8457c 100644 --- a/src/utils/iced.rs +++ b/src/utils/iced/mod.rs @@ -1,3 +1,5 @@ +pub mod state; + use std::{ collections::{HashMap, HashSet}, fmt, @@ -62,7 +64,7 @@ use smithay::{ }, }; -use crate::utils::state::State; +use crate::utils::iced::state::State; static ID: LazyLock = LazyLock::new(|| Id::new("Program")); @@ -97,6 +99,7 @@ impl Hash for IcedElement

{ } } +// TODO remove this and use our Program trait directly instead pub trait IcedProgram { type Message: std::fmt::Debug + Send; fn update(&mut self, _message: Self::Message) -> Task { @@ -145,6 +148,7 @@ pub trait Program { } } +// TODO remove this and use our Program trait directly struct ProgramWrapper { program: P, evlh: LoopHandle<'static, crate::state::State>, diff --git a/src/utils/state.rs b/src/utils/iced/state.rs similarity index 99% rename from src/utils/state.rs rename to src/utils/iced/state.rs index 4425fdf32..ec74a18dc 100644 --- a/src/utils/state.rs +++ b/src/utils/iced/state.rs @@ -1,4 +1,4 @@ -use super::iced::IcedProgram as Program; +use super::IcedProgram as Program; use cosmic::iced::core::event::{self, Event}; use cosmic::iced::core::mouse; use cosmic::iced::core::renderer; diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 69b32a526..ac1df0194 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -9,5 +9,4 @@ pub mod prelude; pub mod quirks; pub mod rlimit; pub mod screenshot; -pub mod state; pub mod tween; From e626735274d8e069ada1c62e0ba0ab9a7e86aab8 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 9 Mar 2026 14:30:44 -0400 Subject: [PATCH 7/9] fix: update test --- examples/customized-window-decorations.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/customized-window-decorations.rs b/examples/customized-window-decorations.rs index 1d0929161..ffe677f19 100644 --- a/examples/customized-window-decorations.rs +++ b/examples/customized-window-decorations.rs @@ -55,7 +55,7 @@ impl Date: Mon, 2 Mar 2026 12:12:50 -0700 Subject: [PATCH 8/9] fix: Ellipsize tab_text and use text widget instead of custom impl --- src/shell/element/stack.rs | 1 - src/shell/element/stack/tab.rs | 12 +- src/shell/element/stack/tab_text.rs | 199 ---------------------------- 3 files changed, 7 insertions(+), 205 deletions(-) delete mode 100644 src/shell/element/stack/tab_text.rs diff --git a/src/shell/element/stack.rs b/src/shell/element/stack.rs index 64daf6eaa..5c0f65513 100644 --- a/src/shell/element/stack.rs +++ b/src/shell/element/stack.rs @@ -81,7 +81,6 @@ use std::{ }; mod tab; -mod tab_text; mod tabs; use self::{ diff --git a/src/shell/element/stack/tab.rs b/src/shell/element/stack/tab.rs index 17fc52623..d07774934 100644 --- a/src/shell/element/stack/tab.rs +++ b/src/shell/element/stack/tab.rs @@ -9,15 +9,14 @@ use cosmic::{ Border, Clipboard, Color, Length, Rectangle, Shell, Size, alignment, event, layout::{Layout, Limits, Node}, mouse, overlay, renderer, + text::{Ellipsize, EllipsizeHeightLimit, Shaping, Wrapping}, widget::{Id, Widget, operation::Operation, tree::Tree}, }, iced_widget::scrollable::AbsoluteOffset, theme, - widget::{Icon, icon::from_name}, + widget::{Icon, icon::from_name, text}, }; -use super::tab_text::tab_text; - #[derive(Clone, Copy)] pub(super) enum TabRuleTheme { ActiveActivated, @@ -196,9 +195,12 @@ impl Tab { .padding([2, 4]) .center_y(Length::Fill) .into(), - tab_text(self.title, self.active) + text::body(self.title) .font(self.font) - .font_size(14.0) + .wrapping(Wrapping::None) + .shaping(Shaping::Advanced) + .ellipsize(Ellipsize::End(EllipsizeHeightLimit::Lines(1))) + .align_y(alignment::Vertical::Center) .height(Length::Fill) .width(Length::Fill) .into(), diff --git a/src/shell/element/stack/tab_text.rs b/src/shell/element/stack/tab_text.rs deleted file mode 100644 index 7a1756418..000000000 --- a/src/shell/element/stack/tab_text.rs +++ /dev/null @@ -1,199 +0,0 @@ -use std::hash::{Hash, Hasher}; - -use cosmic::{ - iced::{Point, alignment}, - iced_core::{ - Background, Border, Color, Degrees, Gradient, Length, Rectangle, Size, Text, gradient, - layout::{Layout, Limits, Node}, - mouse::Cursor, - renderer::{self, Renderer as IcedRenderer}, - text::{Ellipsize, LineHeight, Paragraph, Renderer as TextRenderer, Shaping, Wrapping}, - widget::{Tree, Widget, tree}, - }, -}; - -/// Text in a stack tab with an overflow gradient. -pub fn tab_text(text: String, selected: bool) -> TabText { - TabText::new(text, selected) -} - -struct LocalState { - text_hash: u64, - paragraph: ::Paragraph, - overflowed: bool, -} - -/// Text in a stack tab with an overflow gradient. -pub struct TabText { - text: String, - font: cosmic::font::Font, - font_size: f32, - selected: bool, - height: Length, - width: Length, -} - -impl TabText { - pub fn new(text: String, selected: bool) -> Self { - TabText { - width: Length::Shrink, - height: Length::Shrink, - font: cosmic::font::default(), - font_size: 14.0, - selected, - text, - } - } - - pub fn font(mut self, font: cosmic::font::Font) -> Self { - self.font = font; - self - } - - pub fn font_size(mut self, font_size: f32) -> Self { - self.font_size = font_size; - self - } - - pub fn width(mut self, width: impl Into) -> Self { - let width = width.into(); - self.width = width; - self - } - - pub fn height(mut self, height: impl Into) -> Self { - let height = height.into(); - self.height = height; - self - } - - fn create_hash(&self) -> u64 { - let mut hasher = std::collections::hash_map::DefaultHasher::new(); - self.text.hash(&mut hasher); - self.selected.hash(&mut hasher); - hasher.finish() - } - - fn create_paragraph(&self) -> ::Paragraph { - ::Paragraph::with_text(Text { - content: &self.text, - size: cosmic::iced_core::Pixels(self.font_size), - bounds: Size::INFINITE, - font: self.font, - align_x: cosmic::iced_core::text::Alignment::Left, - align_y: alignment::Vertical::Center, - shaping: Shaping::Advanced, - line_height: LineHeight::default(), - wrapping: Wrapping::None, - ellipsize: Ellipsize::None, - }) - } -} - -impl Widget for TabText { - fn tag(&self) -> tree::Tag { - tree::Tag::of::() - } - - fn state(&self) -> tree::State { - tree::State::new(LocalState { - text_hash: self.create_hash(), - paragraph: self.create_paragraph(), - overflowed: false, - }) - } - - fn size(&self) -> Size { - Size::new(self.width, self.height) - } - - fn layout(&mut self, tree: &mut Tree, _renderer: &cosmic::Renderer, limits: &Limits) -> Node { - let state = tree.state.downcast_mut::(); - let text_bounds = state.paragraph.min_bounds(); - state.overflowed = limits.max().width < text_bounds.width; - let actual_size = limits.resolve(self.width, self.height, text_bounds); - - Node::new(actual_size) - } - - fn diff(&mut self, tree: &mut Tree) { - // If the text changes, update the paragraph. - let state = tree.state.downcast_mut::(); - let text_hash = self.create_hash(); - if state.text_hash != text_hash { - state.text_hash = text_hash; - state.paragraph = self.create_paragraph(); - } - } - - fn draw( - &self, - tree: &Tree, - renderer: &mut cosmic::Renderer, - theme: &cosmic::Theme, - style: &renderer::Style, - layout: Layout<'_>, - _cursor: Cursor, - _viewport: &Rectangle, - ) { - let bounds = layout.bounds(); - let state = tree.state.downcast_ref::(); - - renderer.with_layer(bounds, |renderer| { - renderer.fill_paragraph( - &state.paragraph, - Point::new( - bounds.x, - bounds.y + bounds.height / 2.0 - state.paragraph.min_bounds().height / 2.0, - ), - style.text_color, - bounds, - ); - }); - - if state.overflowed { - let background = if self.selected { - theme - .cosmic() - .primary - .component - .selected_state_color() - .into() - } else { - theme.cosmic().primary_container_color().into() - }; - let transparent = Color { - a: 0.0, - ..background - }; - - renderer.fill_quad( - renderer::Quad { - snap: true, - bounds: Rectangle { - x: (bounds.x + bounds.width - 24.).max(bounds.x), - width: 24.0_f32.min(bounds.width), - ..bounds - }, - border: Border { - radius: 0.0.into(), - width: 0.0, - color: Color::TRANSPARENT, - }, - shadow: Default::default(), - }, - Background::Gradient(Gradient::Linear( - gradient::Linear::new(Degrees(90.)) - .add_stop(0.0, transparent) - .add_stop(1.0, background), - )), - ); - } - } -} - -impl From for cosmic::Element<'_, Message> { - fn from(value: TabText) -> Self { - Self::new(value) - } -} From e7843332b34b430ae2f1e6c0570bfd82bea767d5 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Thu, 12 Mar 2026 11:18:43 -0400 Subject: [PATCH 9/9] fix(headerbar): double click handling & resize only on press --- Cargo.lock | 32 +++++++++++++-------------- src/shell/element/stack.rs | 2 ++ src/shell/element/window.rs | 8 +++++++ src/shell/mod.rs | 3 ++- src/wayland/handlers/xdg_shell/mod.rs | 1 + 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b889ef871..e01986b6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -901,7 +901,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "atomicwrites", "calloop 0.14.4", @@ -922,7 +922,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "quote", "syn", @@ -1000,7 +1000,7 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.18.2" -source = "git+https://github.com/pop-os/cosmic-text.git#b6216ad123814c41c35943390727b4e7146cd143" +source = "git+https://github.com/pop-os/cosmic-text.git#ddad5fb7410e374612925415a13843ed38f14245" dependencies = [ "bitflags 2.11.0", "fontdb", @@ -1023,7 +1023,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "almost", "configparser", @@ -2259,7 +2259,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "dnd", "iced_core", @@ -2278,7 +2278,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "bitflags 2.11.0", "bytes", @@ -2301,7 +2301,7 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "iced_core", "iced_futures", @@ -2311,7 +2311,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "futures", "iced_core", @@ -2324,7 +2324,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "bitflags 2.11.0", "bytemuck", @@ -2345,7 +2345,7 @@ dependencies = [ [[package]] name = "iced_program" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "iced_graphics", "iced_runtime", @@ -2354,7 +2354,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2366,7 +2366,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "bytes", "dnd", @@ -2380,7 +2380,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "bytemuck", "cosmic-text", @@ -2397,7 +2397,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "as-raw-xcb-connection", "bitflags 2.11.0", @@ -2428,7 +2428,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.2" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "dnd", "iced_renderer", @@ -2898,7 +2898,7 @@ checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "libcosmic" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4" +source = "git+https://github.com/pop-os/libcosmic#01e5593741c7aa7eedf0692c6087ee3fb97feeb8" dependencies = [ "apply", "auto_enums", diff --git a/src/shell/element/stack.rs b/src/shell/element/stack.rs index 5c0f65513..aeded0636 100644 --- a/src/shell/element/stack.rs +++ b/src/shell/element/stack.rs @@ -1130,6 +1130,7 @@ impl Program for CosmicStackInternal { .to_i32_round(); cursor.y -= TAB_HEIGHT; let res = shell.menu_request( + false, &surface, &seat, serial, @@ -1172,6 +1173,7 @@ impl Program for CosmicStackInternal { .to_i32_round(); cursor.y -= TAB_HEIGHT; let res = shell.menu_request( + false, &surface, &seat, serial, diff --git a/src/shell/element/window.rs b/src/shell/element/window.rs index 3bfc6349a..ed50bad2a 100644 --- a/src/shell/element/window.rs +++ b/src/shell/element/window.rs @@ -773,6 +773,7 @@ impl Program for CosmicWindowInternal { cursor.y -= SSD_HEIGHT; let res = shell.menu_request( + false, &surface, &seat, serial, @@ -1031,6 +1032,13 @@ impl PointerTarget for CosmicWindow { let Some(surface) = self.wl_surface().map(Cow::into_owned) else { return; }; + + // Only start a resize if the left button was pressed + if event.state != smithay::backend::input::ButtonState::Pressed + || event.button != 0x110 + { + return; + } self.0.loop_handle().insert_idle(move |state| { let res = state.common.shell.write().resize_request( &surface, diff --git a/src/shell/mod.rs b/src/shell/mod.rs index 6ba300d13..5ca05e0a1 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -3429,6 +3429,7 @@ impl Shell { pub fn menu_request( &self, + is_client_initiated: bool, surface: &WlSurface, seat: &Seat, serial: impl Into>, @@ -3439,7 +3440,7 @@ impl Shell { ) -> Option<(MenuGrab, Focus)> { let serial = serial.into(); let Some(GrabStartData::Pointer(start_data)) = - check_grab_preconditions(seat, serial, Some(surface)) + check_grab_preconditions(seat, serial, is_client_initiated.then_some(surface)) else { return None; // TODO: an application can send a menu request for a touch event }; diff --git a/src/wayland/handlers/xdg_shell/mod.rs b/src/wayland/handlers/xdg_shell/mod.rs index 0826db766..6559a7519 100644 --- a/src/wayland/handlers/xdg_shell/mod.rs +++ b/src/wayland/handlers/xdg_shell/mod.rs @@ -368,6 +368,7 @@ impl XdgShellHandler for State { let shell = self.common.shell.read(); let res = shell.menu_request( + true, surface.wl_surface(), &seat, serial,