api: remove ::dummy from Id types

`::dummy` was used for testing purposes and became redundant after
adding e.g. `from_raw` and `into_raw` methods on `Id` types.
This commit is contained in:
daxpedda 2024-09-29 15:49:45 +02:00 committed by GitHub
parent 6e1b9fa24d
commit 32cd1ad9a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 219 additions and 352 deletions

View file

@ -286,7 +286,7 @@ impl Shared {
}
// chorded button event
let device_id = RootDeviceId(DeviceId::new(event.pointer_id()));
let device_id = DeviceId::new(event.pointer_id()).map(RootDeviceId);
if let Some(button) = backend::event::mouse_button(&event) {
let state = if backend::event::mouse_buttons(&event).contains(button.into()) {
@ -327,7 +327,7 @@ impl Shared {
if let Some(delta) = backend::event::mouse_scroll_delta(&window, &event) {
runner.send_event(Event::DeviceEvent {
device_id: RootDeviceId(DeviceId::dummy()),
device_id: None,
event: DeviceEvent::MouseWheel { delta },
});
}
@ -344,7 +344,7 @@ impl Shared {
let button = backend::event::mouse_button(&event).expect("no mouse button pressed");
runner.send_event(Event::DeviceEvent {
device_id: RootDeviceId(DeviceId::new(event.pointer_id())),
device_id: DeviceId::new(event.pointer_id()).map(RootDeviceId),
event: DeviceEvent::Button {
button: button.to_id(),
state: ElementState::Pressed,
@ -363,7 +363,7 @@ impl Shared {
let button = backend::event::mouse_button(&event).expect("no mouse button pressed");
runner.send_event(Event::DeviceEvent {
device_id: RootDeviceId(DeviceId::new(event.pointer_id())),
device_id: DeviceId::new(event.pointer_id()).map(RootDeviceId),
event: DeviceEvent::Button {
button: button.to_id(),
state: ElementState::Released,
@ -381,7 +381,7 @@ impl Shared {
}
runner.send_event(Event::DeviceEvent {
device_id: RootDeviceId(DeviceId::dummy()),
device_id: None,
event: DeviceEvent::Key(RawKeyEvent {
physical_key: backend::event::key_code(&event),
state: ElementState::Pressed,
@ -399,7 +399,7 @@ impl Shared {
}
runner.send_event(Event::DeviceEvent {
device_id: RootDeviceId(DeviceId::dummy()),
device_id: None,
event: DeviceEvent::Key(RawKeyEvent {
physical_key: backend::event::key_code(&event),
state: ElementState::Released,