Skip to content

Commit f5a2051

Browse files
committed
Update libcosmic and iced
1 parent f851dab commit f5a2051

File tree

3 files changed

+46
-65
lines changed

3 files changed

+46
-65
lines changed

Cargo.lock

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app.rs

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3925,36 +3925,25 @@ impl Application for App {
39253925
struct TrashWatcherSubscription;
39263926

39273927
let mut subscriptions = vec![
3928-
event::listen_with(|event, status, window_id| {
3929-
//TODO: why are we getting keyboard events for this window Id?
3930-
if window_id == window::Id::NONE {
3931-
return match event {
3932-
#[cfg(feature = "wayland")]
3933-
Event::PlatformSpecific(event::PlatformSpecific::Wayland(
3934-
wayland_event,
3935-
)) => {
3936-
println!("{:?}", wayland_event);
3937-
match wayland_event {
3938-
WaylandEvent::Output(output_event, output) => {
3939-
Some(Message::OutputEvent(output_event, output))
3940-
}
3941-
_ => None,
3942-
}
3928+
event::listen_with(|event, status, _window_id| match event {
3929+
Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => match status {
3930+
event::Status::Ignored => Some(Message::Key(modifiers, key)),
3931+
event::Status::Captured => None,
3932+
},
3933+
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
3934+
Some(Message::Modifiers(modifiers))
3935+
}
3936+
Event::Window(WindowEvent::CloseRequested) => Some(Message::WindowClose),
3937+
#[cfg(feature = "wayland")]
3938+
Event::PlatformSpecific(event::PlatformSpecific::Wayland(wayland_event)) => {
3939+
match wayland_event {
3940+
WaylandEvent::Output(output_event, output) => {
3941+
Some(Message::OutputEvent(output_event, output))
39433942
}
39443943
_ => None,
3945-
};
3946-
}
3947-
match event {
3948-
Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => match status {
3949-
event::Status::Ignored => Some(Message::Key(modifiers, key)),
3950-
event::Status::Captured => None,
3951-
},
3952-
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
3953-
Some(Message::Modifiers(modifiers))
39543944
}
3955-
Event::Window(WindowEvent::CloseRequested) => Some(Message::WindowClose),
3956-
_ => None,
39573945
}
3946+
_ => None,
39583947
}),
39593948
Config::subscription().map(|update| {
39603949
if !update.errors.is_empty() {

src/dialog.rs

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl<M: Send + 'static> Dialog<M> {
173173
let (window_id, window_command) = window::open(settings.clone());
174174

175175
let mut core = Core::default();
176-
core.set_main_window_id(window_id);
176+
core.set_main_window_id(Some(window_id));
177177
let flags = Flags {
178178
kind,
179179
path_opt: path_opt
@@ -190,9 +190,7 @@ impl<M: Send + 'static> Dialog<M> {
190190
config,
191191
};
192192

193-
// settings here is unused
194-
let (mut cosmic, cosmic_command) = Cosmic::<App>::init((core, flags, settings));
195-
193+
let (cosmic, cosmic_command) = Cosmic::<App>::init((core, flags));
196194
(
197195
Self {
198196
cosmic,
@@ -1586,21 +1584,15 @@ impl Application for App {
15861584
fn subscription(&self) -> Subscription<Message> {
15871585
struct WatcherSubscription;
15881586
let mut subscriptions = vec![
1589-
event::listen_with(|event, status, window_id| {
1590-
//TODO: why are we getting events for this window Id?
1591-
if window_id == window::Id::NONE {
1592-
return None;
1593-
}
1594-
match event {
1595-
Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => match status {
1596-
event::Status::Ignored => Some(Message::Key(modifiers, key)),
1597-
event::Status::Captured => None,
1598-
},
1599-
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
1600-
Some(Message::Modifiers(modifiers))
1601-
}
1602-
_ => None,
1587+
event::listen_with(|event, status, _window_id| match event {
1588+
Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => match status {
1589+
event::Status::Ignored => Some(Message::Key(modifiers, key)),
1590+
event::Status::Captured => None,
1591+
},
1592+
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
1593+
Some(Message::Modifiers(modifiers))
16031594
}
1595+
_ => None,
16041596
}),
16051597
Config::subscription().map(|update| {
16061598
if !update.errors.is_empty() {

0 commit comments

Comments
 (0)