Fix handling wayland events
This commit is contained in:
parent
85a483f638
commit
717f26b942
1 changed files with 16 additions and 12 deletions
28
src/app.rs
28
src/app.rs
|
|
@ -1348,7 +1348,6 @@ impl Application for App {
|
||||||
});
|
});
|
||||||
|
|
||||||
let window_id_opt = core.main_window_id();
|
let window_id_opt = core.main_window_id();
|
||||||
println!("WINDOW ID {:?}", window_id_opt);
|
|
||||||
|
|
||||||
let mut app = App {
|
let mut app = App {
|
||||||
core,
|
core,
|
||||||
|
|
@ -3927,9 +3926,23 @@ impl Application for App {
|
||||||
|
|
||||||
let mut subscriptions = vec![
|
let mut subscriptions = vec![
|
||||||
event::listen_with(|event, status, window_id| {
|
event::listen_with(|event, status, window_id| {
|
||||||
//TODO: why are we getting events for this window Id?
|
//TODO: why are we getting keyboard events for this window Id?
|
||||||
if window_id == window::Id::NONE {
|
if window_id == window::Id::NONE {
|
||||||
return None;
|
return match event {
|
||||||
|
#[cfg(feature = "wayland")]
|
||||||
|
Event::PlatformSpecific(event::PlatformSpecific::Wayland(
|
||||||
|
wayland_event,
|
||||||
|
)) => {
|
||||||
|
println!("{:?}", wayland_event);
|
||||||
|
match wayland_event {
|
||||||
|
WaylandEvent::Output(output_event, output) => {
|
||||||
|
Some(Message::OutputEvent(output_event, output))
|
||||||
|
}
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
match event {
|
match event {
|
||||||
Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => match status {
|
Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => match status {
|
||||||
|
|
@ -3940,15 +3953,6 @@ impl Application for App {
|
||||||
Some(Message::Modifiers(modifiers))
|
Some(Message::Modifiers(modifiers))
|
||||||
}
|
}
|
||||||
Event::Window(WindowEvent::CloseRequested) => Some(Message::WindowClose),
|
Event::Window(WindowEvent::CloseRequested) => Some(Message::WindowClose),
|
||||||
#[cfg(feature = "wayland")]
|
|
||||||
Event::PlatformSpecific(event::PlatformSpecific::Wayland(wayland_event)) => {
|
|
||||||
match wayland_event {
|
|
||||||
WaylandEvent::Output(output_event, output) => {
|
|
||||||
Some(Message::OutputEvent(output_event, output))
|
|
||||||
}
|
|
||||||
_ => None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue