wayland: Set cusor position on Enter events

Fixes https://github.com/pop-os/cosmic-workspaces-epoch/issues/143.

The way some events are converted to `WindowEvent`s in `pointer_frame`
but motion is handled in `SctkEvent::process` seems a little cluttered
at the moment, I guess from how this code was ported to be part of
iced-winit instead of separate. But as I understand, the code handling
`PointerEventKind::Enter` in `SctkEvent::enter` wasn't being called, so
that can be replaced with the new code here that sets the logical cursor
position.
This commit is contained in:
Ian Douglas Scott 2025-04-07 09:52:02 -07:00 • committed by Ashley Wulber
parent b775402f65
commit 53fed52405
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
2 changed files with 22 additions and 8 deletions

View file

@ -66,6 +66,18 @@ impl PointerHandler for SctkState {
*entry = FrameStatus::Ready;
}
if let PointerEventKind::Enter { .. } = &e.kind {
self.sctk_events.push(SctkEvent::PointerEvent {
variant: PointerEvent {
surface: e.surface.clone(),
position: e.position,
kind: e.kind.clone(),
},
ptr_id: pointer.clone(),
seat_id: my_seat.seat.clone(),
});
}
if let PointerEventKind::Motion { time } = &e.kind {
self.sctk_events.push(SctkEvent::PointerEvent {
variant: PointerEvent {