chore: fixes after libcosmic update

This commit is contained in:
Hojjat 2026-05-26 10:51:59 -06:00 committed by Ashley Wulber
parent cdec335ac7
commit 355423a027
4 changed files with 23 additions and 11 deletions

View file

@ -7,6 +7,7 @@ use cosmic::iced::clipboard::dnd::DndAction;
use cosmic::iced::core::SmolStr;
use cosmic::iced::core::widget::operation::focusable::unfocus;
use cosmic::iced::futures::{self, SinkExt};
use cosmic::iced::keyboard::key::Physical;
use cosmic::iced::keyboard::{Event as KeyEvent, Key, Modifiers};
#[cfg(all(feature = "wayland", feature = "desktop-applet"))]
use cosmic::iced::platform_specific::shell::wayland::commands::overlap_notify::overlap_notify;
@ -355,7 +356,7 @@ pub enum Message {
ExtractToResult(DialogResult),
#[cfg(all(feature = "wayland", feature = "desktop-applet"))]
Focused(window::Id),
Key(window::Id, Modifiers, Key, Option<SmolStr>),
Key(window::Id, Modifiers, Key, Physical, Option<SmolStr>),
LaunchUrl(String),
MaybeExit,
ModifiersChanged(window::Id, Modifiers),
@ -3351,7 +3352,7 @@ impl Application for App {
return dialog.update(dialog_message);
}
}
Message::Key(window_id, modifiers, key, text) => {
Message::Key(window_id, modifiers, key, physical_key, text) => {
#[cfg(all(feature = "wayland", feature = "desktop-applet"))]
let in_surface_ids = self.surface_ids.values().any(|id| *id == window_id);
#[cfg(not(all(feature = "wayland", feature = "desktop-applet")))]
@ -3359,7 +3360,7 @@ impl Application for App {
if self.core.main_window_id() == Some(window_id) || in_surface_ids {
let entity = self.tab_model.active();
for (key_bind, action) in &self.key_binds {
if key_bind.matches(modifiers, &key) {
if key_bind.matches(modifiers, &key, Some(&physical_key)) {
return self.update(action.message(Some(entity)));
}
}
@ -6633,11 +6634,14 @@ impl Application for App {
},
Event::Keyboard(KeyEvent::KeyPressed {
key,
physical_key,
modifiers,
text,
..
}) => match status {
event::Status::Ignored => Some(Message::Key(window_id, modifiers, key, text)),
event::Status::Ignored => {
Some(Message::Key(window_id, modifiers, key, physical_key, text))
}
event::Status::Captured => None,
},
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {