Skip to content

Commit

Permalink
chore: update modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Jul 31, 2024
1 parent 33fd1c6 commit e2e4881
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
7 changes: 2 additions & 5 deletions iced_layershell/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,8 @@ where
// TODO: maybe use it later
LayerEvent::BindProvide(_, _) => {}
LayerEvent::RequestMessages(message) => {
match message {
DispatchMessage::MouseEnter { serial, .. } => {
pointer_serial = *serial;
}
_ => {}
if let DispatchMessage::MouseEnter { serial, .. } = message {
pointer_serial = *serial;
}

event_sender
Expand Down
3 changes: 3 additions & 0 deletions iced_layershell/src/application/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ where
WindowEvent::CursorMoved { x, y } => {
self.mouse_position = Some(Point::new(*x as f32, *y as f32));
}
WindowEvent::ModifiersChanged(modifiers) => {
self.modifiers = *modifiers;
}
_ => {}
}
}
Expand Down
2 changes: 1 addition & 1 deletion iced_layershell/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn window_event(
}
})),
LayerShellEvent::ModifiersChanged(new_modifiers) => Some(IcedEvent::Keyboard(
keyboard::Event::ModifiersChanged(keymap::modifiers(new_modifiers.clone())),
keyboard::Event::ModifiersChanged(keymap::modifiers(*new_modifiers)),
)),
_ => None,
}
Expand Down
3 changes: 3 additions & 0 deletions iced_layershell/src/multi_window/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ where
WindowEvent::CursorMoved { x, y } => {
self.mouse_position = Some(Point::new(*x as f32, *y as f32));
}
WindowEvent::ModifiersChanged(modifiers) => {
self.modifiers = *modifiers;
}
_ => {}
}
}
Expand Down
3 changes: 3 additions & 0 deletions iced_sessionlock/src/multi_window/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ where
WindowEvent::CursorMoved { x, y } => {
self.mouse_position = Some(Point::new(*x as f32, *y as f32));
}
WindowEvent::ModifiersChanged(modifiers) => {
self.modifiers = modifiers.clone();
}
_ => {}
}
}
Expand Down

0 comments on commit e2e4881

Please sign in to comment.