From 131cf7e8cddc98a8e9ca38a4e71c7014fa435b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuka=C5=A1in=20Vojinovi=C4=87?= <150025636+git-f0x@users.noreply.github.com> Date: Sat, 13 Sep 2025 11:00:48 +0200 Subject: [PATCH] chore: make dbus-config optional Also fixes some lints. --- Cargo.lock | 132 +++++++++++++++++++++++++++------------------ Cargo.toml | 11 +--- examples/dialog.rs | 4 +- src/app.rs | 24 ++++----- src/dialog.rs | 16 +++--- src/tab.rs | 26 ++++++--- 6 files changed, 123 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b5c97f..a0b47b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -964,9 +964,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.36" +version = "1.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5252b3d2648e5eedbc1a6f501e3c795e07025c1e93bbf8bbdd6eef7f447a6d54" +checksum = "65193589c6404eb80b450d618eaf9a2cafaaafd57ecce47370519ef674a7bd44" dependencies = [ "find-msvc-tools", "jobserver", @@ -1437,7 +1437,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1447,7 +1447,7 @@ dependencies = [ "iced_futures", "known-folders", "notify", - "ron 0.11.0", + "ron", "serde", "tokio", "tracing", @@ -1458,7 +1458,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "quote", "syn 2.0.106", @@ -1578,15 +1578,14 @@ dependencies = [ [[package]] name = "cosmic-settings-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-settings-daemon#66e5f1d82b4daa62b028139e93a58e471bc5ac9e" +source = "git+https://github.com/pop-os/cosmic-settings-daemon#ee782f454a09310a28abe73653e6c82d06a79855" dependencies = [ "cosmic-config", - "ron 0.9.0", + "ron", "serde", "serde_with", - "thiserror 2.0.16", "tracing", - "xkbcommon 0.7.0", + "xkbcommon 0.9.0", ] [[package]] @@ -1622,14 +1621,14 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "almost", "cosmic-config", "csscolorparser", "dirs 6.0.0", "palette", - "ron 0.11.0", + "ron", "serde", "serde_json", "thiserror 2.0.16", @@ -2947,9 +2946,9 @@ dependencies = [ [[package]] name = "harfrust" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406a98b615ed380f2195fa8fb2ed3083e64b2a6329d710e06f95a42466f0f0c4" +checksum = "75a4c970f1a00edc1626f1e3cc039492b15b73df28b9fff70f95404a571b4fae" dependencies = [ "bitflags 2.9.4", "bytemuck", @@ -3111,9 +3110,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.63" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3121,7 +3120,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.61.2", + "windows-core 0.62.0", ] [[package]] @@ -3136,7 +3135,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "dnd", "iced_accessibility", @@ -3154,7 +3153,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "accesskit", "accesskit_winit", @@ -3163,7 +3162,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "bitflags 2.9.4", "bytes", @@ -3187,7 +3186,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "futures", "iced_core", @@ -3213,7 +3212,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "bitflags 2.9.4", "bytemuck", @@ -3235,7 +3234,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -3247,7 +3246,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "bytes", "cosmic-client-toolkit", @@ -3262,7 +3261,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "bytemuck", "cosmic-text", @@ -3278,7 +3277,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "as-raw-xcb-connection", "bitflags 2.9.4", @@ -3309,7 +3308,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "cosmic-client-toolkit", "dnd", @@ -3328,7 +3327,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "cosmic-client-toolkit", "dnd", @@ -4475,7 +4474,7 @@ checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#e568122083ebc42d11e82b95ecc2e233c00554f7" +source = "git+https://github.com/pop-os/libcosmic.git#b9a00c6e799b80154190f11943bb65c1fc4dc58b" dependencies = [ "apply", "ashpd 0.12.0", @@ -4667,9 +4666,9 @@ checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" [[package]] name = "lyon" -version = "1.0.1" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e7f9cda98b5430809e63ca5197b06c7d191bf7e26dfc467d5a3f0290e2a74f" +checksum = "dbcb7d54d54c8937364c9d41902d066656817dce1e03a44e5533afebd1ef4352" dependencies = [ "lyon_algorithms", "lyon_tessellation", @@ -4677,9 +4676,9 @@ dependencies = [ [[package]] name = "lyon_algorithms" -version = "1.0.5" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f13c9be19d257c7d37e70608ed858e8eab4b2afcea2e3c9a622e892acbf43c08" +checksum = "f4c0829e28c4f336396f250d850c3987e16ce6db057ffe047ce0dd54aab6b647" dependencies = [ "lyon_path", "num-traits", @@ -4687,9 +4686,9 @@ dependencies = [ [[package]] name = "lyon_geom" -version = "1.0.6" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8af69edc087272df438b3ee436c4bb6d7c04aa8af665cfd398feae627dbd8570" +checksum = "ce9333c02ea4517fd31207f126124352ad59975218c114c55dbb8f9d56fd4b45" dependencies = [ "arrayvec", "euclid", @@ -4698,9 +4697,9 @@ dependencies = [ [[package]] name = "lyon_path" -version = "1.0.7" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0047f508cd7a85ad6bad9518f68cce7b1bf6b943fb71f6da0ee3bc1e8cb75f25" +checksum = "1aeca86bcfd632a15984ba029b539ffb811e0a70bf55e814ef8b0f54f506fdeb" dependencies = [ "lyon_geom", "num-traits", @@ -4708,9 +4707,9 @@ dependencies = [ [[package]] name = "lyon_tessellation" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579d42360a4b09846eff2feef28f538696c7d6c7439bfa65874ff3cbe0951b2c" +checksum = "f3f586142e1280335b1bc89539f7c97dd80f08fc43e9ab1b74ef0a42b04aa353" dependencies = [ "float_next_after", "lyon_path", @@ -6387,19 +6386,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "ron" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63f3aa105dea217ef30d89581b65a4d527a19afc95ef5750be3890e8d3c5b837" -dependencies = [ - "base64", - "bitflags 2.9.4", - "serde", - "serde_derive", - "unicode-ident", -] - [[package]] name = "ron" version = "0.11.0" @@ -8336,7 +8322,20 @@ dependencies = [ "windows-interface 0.59.1", "windows-link 0.1.3", "windows-result 0.3.4", - "windows-strings", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-core" +version = "0.62.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57fe7168f7de578d2d8a05b07fd61870d2e73b4020e9f49aa00da8471723497c" +dependencies = [ + "windows-implement 0.60.0", + "windows-interface 0.59.1", + "windows-link 0.2.0", + "windows-result 0.4.0", + "windows-strings 0.5.0", ] [[package]] @@ -8456,6 +8455,15 @@ dependencies = [ "windows-link 0.1.3", ] +[[package]] +name = "windows-result" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7084dcc306f89883455a206237404d3eaf961e5bd7e0f312f7c91f57eb44167f" +dependencies = [ + "windows-link 0.2.0", +] + [[package]] name = "windows-strings" version = "0.4.2" @@ -8465,6 +8473,15 @@ dependencies = [ "windows-link 0.1.3", ] +[[package]] +name = "windows-strings" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7218c655a553b0bed4426cf54b20d7ba363ef543b52d515b3e48d7fd55318dda" +dependencies = [ + "windows-link 0.2.0", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -8981,6 +8998,17 @@ dependencies = [ "xkeysym", ] +[[package]] +name = "xkbcommon" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a974f48060a14e95705c01f24ad9c3345022f4d97441b8a36beb7ed5c4a02d" +dependencies = [ + "libc", + "memmap2 0.9.8", + "xkeysym", +] + [[package]] name = "xkbcommon-dl" version = "0.4.2" diff --git a/Cargo.toml b/Cargo.toml index a5da561..bfbfeaf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,19 +83,12 @@ optional = true git = "https://github.com/pop-os/libcosmic.git" default-features = false #TODO: a11y feature crashes -features = [ - "about", - "autosize", - "dbus-config", - "multi-window", - "tokio", - "winit", - "surface-message", -] +features = ["about", "autosize", "multi-window", "tokio", "winit", "surface-message"] [features] default = [ "bzip2", + "dbus-config", "desktop", "gvfs", "io-uring", diff --git a/examples/dialog.rs b/examples/dialog.rs index 303ec29..bc64519 100644 --- a/examples/dialog.rs +++ b/examples/dialog.rs @@ -114,14 +114,14 @@ impl Application for App { Task::none() } - fn view_window(&self, window_id: window::Id) -> Element { + fn view_window(&self, window_id: window::Id) -> Element<'_, Message> { match &self.dialog_opt { Some(dialog) => dialog.view(window_id), None => widget::text::body("No dialog").into(), } } - fn view(&self) -> Element { + fn view(&self) -> Element<'_, Message> { let mut column = widget::column().spacing(8).padding(8); { let mut button = widget::button::standard("Open File"); diff --git a/src/app.rs b/src/app.rs index 732bda1..79bd665 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1616,7 +1616,7 @@ impl App { Task::none() } - fn network_drive(&self) -> Element { + fn network_drive(&self) -> Element<'_, Message> { let cosmic_theme::Spacing { space_xxs, space_m, .. } = theme::active().cosmic().spacing; @@ -1647,7 +1647,7 @@ impl App { .into() } - fn desktop_view_options(&self) -> Element { + fn desktop_view_options(&self) -> Element<'_, Message> { let cosmic_theme::Spacing { space_m, space_l, .. } = theme::active().cosmic().spacing; @@ -1729,7 +1729,7 @@ impl App { .into() } - fn edit_history(&self) -> Element { + fn edit_history(&self) -> Element<'_, Message> { let cosmic_theme::Spacing { space_m, .. } = theme::active().cosmic().spacing; let mut children = Vec::new(); @@ -1879,7 +1879,7 @@ impl App { .into() } - fn settings(&self) -> Element { + fn settings(&self) -> Element<'_, Message> { let tab_config = self.config.tab; // TODO: Should dialog be updated here too? @@ -2195,7 +2195,7 @@ impl Application for App { (app, Task::batch(commands)) } - fn nav_bar(&self) -> Option>> { + fn nav_bar(&self) -> Option>> { if !self.core.nav_bar_active() { return None; } @@ -4687,7 +4687,7 @@ impl Application for App { Task::none() } - fn context_drawer(&self) -> Option> { + fn context_drawer(&self) -> Option> { if !self.core.window.show_context { return None; } @@ -4755,7 +4755,7 @@ impl Application for App { }) } - fn dialog(&self) -> Option> { + fn dialog(&self) -> Option> { //TODO: should gallery view just be a dialog? let entity = self.tab_model.active(); if let Some(tab) = self.tab_model.data::(entity) { @@ -5455,7 +5455,7 @@ impl Application for App { Some(dialog.into()) } - fn footer(&self) -> Option> { + fn footer(&self) -> Option> { if self.progress_operations.is_empty() { return None; } @@ -5568,7 +5568,7 @@ impl Application for App { Some(container.into()) } - fn header_start(&self) -> Vec> { + fn header_start(&self) -> Vec> { vec![menu::menu_bar( &self.core, self.tab_model.active_data::(), @@ -5578,7 +5578,7 @@ impl Application for App { )] } - fn header_end(&self) -> Vec> { + fn header_end(&self) -> Vec> { let mut elements = Vec::with_capacity(2); if let Some(term) = self.search_get() { @@ -5614,7 +5614,7 @@ impl Application for App { } /// Creates a view after each update. - fn view(&self) -> Element { + fn view(&self) -> Element<'_, Self::Message> { let cosmic_theme::Spacing { space_xxs, space_s, .. } = theme::active().cosmic().spacing; @@ -5680,7 +5680,7 @@ impl Application for App { content } - fn view_window(&self, id: WindowId) -> Element { + fn view_window(&self, id: WindowId) -> Element<'_, Self::Message> { let content = match self.windows.get(&id) { Some(WindowKind::ContextMenu(entity, id)) => { match self.tab_model.data::(*entity) { diff --git a/src/dialog.rs b/src/dialog.rs index 9bc2f76..935a41a 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -375,7 +375,7 @@ impl Dialog { } } - pub fn view(&self, window_id: window::Id) -> Element { + pub fn view(&self, window_id: window::Id) -> Element<'_, M> { self.cosmic .view(window_id) .map(DialogMessage) @@ -518,7 +518,7 @@ struct App { } impl App { - fn button_view(&self) -> Element { + fn button_view(&self) -> Element<'_, Message> { let cosmic_theme::Spacing { space_xxxs, space_xxs, @@ -991,7 +991,7 @@ impl Application for App { (app, commands) } - fn context_drawer(&self) -> Option> { + fn context_drawer(&self) -> Option> { if !self.core.window.show_context { return None; } @@ -1022,7 +1022,7 @@ impl Application for App { } } - fn dialog(&self) -> Option> { + fn dialog(&self) -> Option> { let cosmic_theme::Spacing { space_xxs, .. } = theme::active().cosmic().spacing; //TODO: should gallery view just be a dialog? @@ -1122,11 +1122,11 @@ impl Application for App { Some(dialog.into()) } - fn footer(&self) -> Option> { + fn footer(&self) -> Option> { Some(self.button_view()) } - fn header_end(&self) -> Vec> { + fn header_end(&self) -> Vec> { let mut elements = Vec::with_capacity(3); if let Some(term) = self.search_get() { @@ -1177,7 +1177,7 @@ impl Application for App { elements } - fn nav_bar(&self) -> Option>> { + fn nav_bar(&self) -> Option>> { if !self.core().nav_bar_active() { return None; } @@ -1879,7 +1879,7 @@ impl Application for App { } /// Creates a view after each update. - fn view(&self) -> Element { + fn view(&self) -> Element<'_, Message> { let cosmic_theme::Spacing { space_xxs, .. } = theme::active().cosmic().spacing; let mut col = widget::column::with_capacity(2); diff --git a/src/tab.rs b/src/tab.rs index e4f7987..e6f5538 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -2070,7 +2070,7 @@ impl Item { } } - pub fn preview_header(&self) -> Vec> { + pub fn preview_header(&self) -> Vec> { let mut row = Vec::with_capacity(3); row.push( widget::button::icon(widget::icon::from_name("go-previous-symbolic")) @@ -4167,7 +4167,7 @@ impl Tab { container.into() } - pub fn gallery_view(&self) -> Element { + pub fn gallery_view(&self) -> Element<'_, Message> { let cosmic_theme::Spacing { space_xxs, space_xs, @@ -4298,7 +4298,7 @@ impl Tab { .into() } - pub fn location_view(&self) -> Element { + pub fn location_view(&self) -> Element<'_, Message> { //TODO: responsiveness is done in a hacky way, potentially move this to a custom widget? fn text_width<'a>( content: &'a str, @@ -4648,7 +4648,7 @@ impl Tab { popover.into() } - pub fn empty_view(&self, has_hidden: bool) -> Element { + pub fn empty_view(&self, has_hidden: bool) -> Element<'_, Message> { let cosmic_theme::Spacing { space_xxs, .. } = theme::active().cosmic().spacing; mouse_area::MouseArea::new(widget::column::with_children(vec![ @@ -4680,7 +4680,13 @@ impl Tab { .into() } - pub fn grid_view(&self) -> (Option>, Element, bool) { + pub fn grid_view( + &self, + ) -> ( + Option>, + Element<'_, Message>, + bool, + ) { let cosmic_theme::Spacing { space_xxs, space_xxxs, @@ -5014,7 +5020,13 @@ impl Tab { (drag_list, mouse_area.into(), true) } - pub fn list_view(&self) -> (Option>, Element, bool) { + pub fn list_view( + &self, + ) -> ( + Option>, + Element<'_, Message>, + bool, + ) { let cosmic_theme::Spacing { space_s, space_xxs, .. } = theme::active().cosmic().spacing; @@ -5404,7 +5416,7 @@ impl Tab { &self, key_binds: &HashMap, size: Size, - ) -> Element { + ) -> Element<'_, Message> { // Update cached size self.size_opt.set(Some(size));