From a301e6450315446fdaaf4c18878c2b81b28d281b Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 26 May 2026 15:40:59 -0400 Subject: [PATCH] fix: libcosmic updates --- Cargo.lock | 28 +++++++++++++++++++--------- src/main.rs | 15 ++++++++++----- src/menu.rs | 1 + src/terminal_box.rs | 3 +++ 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index af67d14..3dafeea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1310,7 +1310,7 @@ version = "0.2.0" source = "git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1#c253ec1d6804afbcdf250f5cc37ae1194bba7bd2" dependencies = [ "bitflags 2.11.1", - "cosmic-protocols 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", + "cosmic-protocols", "libc", "smithay-client-toolkit", "wayland-client", @@ -1353,7 +1353,7 @@ dependencies = [ "atomic_float", "bstr", "compio", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=160b086)", + "cosmic-client-toolkit", "dirs 6.0.0", "filetime", "flate2", @@ -2863,7 +2863,7 @@ version = "0.14.0" dependencies = [ "bitflags 2.11.1", "bytes", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", + "cosmic-client-toolkit", "dnd", "glam", "lilt", @@ -2947,7 +2947,7 @@ name = "iced_runtime" version = "0.14.0" dependencies = [ "bytes", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", + "cosmic-client-toolkit", "dnd", "iced_core", "iced_futures", @@ -2978,7 +2978,7 @@ version = "0.14.0" dependencies = [ "bitflags 2.11.1", "bytemuck", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", + "cosmic-client-toolkit", "cryoglyph", "futures", "glam", @@ -3003,7 +3003,7 @@ dependencies = [ name = "iced_widget" version = "0.14.2" dependencies = [ - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", + "cosmic-client-toolkit", "dnd", "iced_renderer", "iced_runtime", @@ -3020,7 +3020,7 @@ dependencies = [ name = "iced_winit" version = "0.14.0" dependencies = [ - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", + "cosmic-client-toolkit", "cursor-icon", "dnd", "iced_debug", @@ -4106,7 +4106,7 @@ dependencies = [ "apply", "ashpd 0.12.3", "auto_enums", - "cosmic-client-toolkit 0.2.0 (git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1)", + "cosmic-client-toolkit", "cosmic-config", "cosmic-freedesktop-icons", "cosmic-settings-daemon", @@ -5747,6 +5747,16 @@ dependencies = [ "url", ] +[[package]] +name = "redox_event" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea3e412d205440c7b0218af26247226f979ed1201674cda7a33cc70609084b5" +dependencies = [ + "bitflags 2.11.1", + "libredox", +] + [[package]] name = "redox_syscall" version = "0.5.18" @@ -8209,7 +8219,7 @@ dependencies = [ "libredox", "orbclient", "raw-window-handle", - "redox_syscall 0.7.5", + "redox_event", "smol_str", "tracing", "winit-core", diff --git a/src/main.rs b/src/main.rs index 9096544..e2dff69 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use alacritty_terminal::{event::Event as TermEvent, term, term::color::Colors as TermColors, tty}; use cosmic::iced::clipboard::dnd::DndAction; use cosmic::iced::core::keyboard::key::Named; +use cosmic::iced::keyboard::key::Physical; use cosmic::widget::menu::action::MenuAction; use cosmic::widget::menu::key_bind::KeyBind; use cosmic::widget::pane_grid::Pane; @@ -385,7 +386,7 @@ pub enum Message { FindSearchValueChanged(String), MiddleClick(pane_grid::Pane, Option), FocusFollowMouse(bool), - Key(Modifiers, Key), + Key(Modifiers, Physical, Key), LaunchUrl(String), LaunchUrlByMenu, Modifiers(Modifiers), @@ -1002,6 +1003,7 @@ impl App { //TODO: re-export in libcosmic iced::widget::text::Style { color: Some(cosmic.destructive_text_color().into()), + ..Default::default() } })) .into(), @@ -2433,7 +2435,7 @@ impl Application for App { Message::FocusFollowMouse(focus_follow_mouse) => { config_set!(focus_follow_mouse, focus_follow_mouse); } - Message::Key(modifiers, key) => { + Message::Key(modifiers, physical, key) => { // Hard-coded keys match key { Key::Named(Named::Copy) => { @@ -3702,9 +3704,12 @@ impl Application for App { Subscription::batch([ event::listen_with(|event, _status, _window_id| match event { - Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => { - Some(Message::Key(modifiers, key)) - } + Event::Keyboard(KeyEvent::KeyPressed { + key, + physical_key, + modifiers, + .. + }) => Some(Message::Key(modifiers, physical_key, key)), Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => { Some(Message::Modifiers(modifiers)) } diff --git a/src/menu.rs b/src/menu.rs index d2fdd00..627f5ca 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -49,6 +49,7 @@ pub fn context_menu<'a>( color.alpha *= 0.75; TextStyle { color: Some(color.into()), + ..Default::default() } } diff --git a/src/terminal_box.rs b/src/terminal_box.rs index d3c3a8b..310213a 100644 --- a/src/terminal_box.rs +++ b/src/terminal_box.rs @@ -936,6 +936,7 @@ where }, Event::Keyboard(KeyEvent::KeyPressed { key: Key::Named(named), + physical_key, modified_key: Key::Named(modified_named), modifiers, text, @@ -1102,6 +1103,7 @@ where text, modifiers, key, + physical_key, .. }) if state.is_focused && *key == Key::Character(SmolStr::new(" ")) => { //Special handle Enter, Escape, Backspace and Tab as described in @@ -1127,6 +1129,7 @@ where text, modifiers, key, + physical_key, .. }) if state.is_focused => { for key_bind in self.key_binds.keys() {