Fixes for new libcosmic

This commit is contained in:
Jeremy Soller 2026-05-26 13:14:56 -06:00 committed by Lionel DARNIS
parent e56a3a4936
commit 3035ae3565

View file

@ -5,6 +5,7 @@ use cosmic::app::{Core, Settings, Task, context_drawer};
use cosmic::command::set_theme;
use cosmic::cosmic_config::{self, CosmicConfigEntry};
use cosmic::iced::event::{self, Event};
use cosmic::iced::keyboard::key::Physical;
use cosmic::iced::keyboard::{Event as KeyEvent, Key, Modifiers};
use cosmic::iced::mouse::{Event as MouseEvent, ScrollDelta};
use cosmic::iced::{
@ -2061,9 +2062,12 @@ impl Application for App {
let mut subscriptions = vec![
event::listen_with(|event, _status, _window_id| match event {
Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => {
Some(Message::Key(modifiers, key))
}
Event::Keyboard(KeyEvent::KeyPressed {
modifiers,
physical_key,
key,
..
}) => Some(Message::Key(modifiers, physical_key, key)),
Event::Mouse(MouseEvent::CursorMoved { .. }) => Some(Message::ShowControls),
Event::Mouse(MouseEvent::WheelScrolled { delta }) => Some(Message::Scrolled(delta)),
_ => None,