Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out how to deal with wl_pointer::frame for relative pointer and the like #1126

Closed
ids1024 opened this issue Sep 8, 2023 · 2 comments

Comments

@ids1024
Copy link
Member

ids1024 commented Sep 8, 2023

It seems the expected behavior is for relative_motion to be followed by frame, probably in the same frame as the motion. In cosmic-comp I made this work by calling relative_motion before motion (pop-os/cosmic-comp#167), but that's going to be a problem with pointer constraints where only relative_motion events may occur.

ids1024 added a commit to pop-os/cosmic-comp that referenced this issue Sep 14, 2023
Depends on Smithay/smithay#872.

For some reason, pointer confinment isn't working correctly here at the
moment, even though the code matches Anvil...

May need solution to Smithay/smithay#1126 for
behavior to be correct.
@ids1024
Copy link
Member Author

ids1024 commented Sep 18, 2023

One solution to this for (relative) motion events is to combine the two events into one with 2 Options:

/// Pointer motion event
#[derive(Debug, Clone)]
pub struct AbsoluteMotion {
    /// Location of the pointer in compositor space
    pub location: Point<f64, Logical>,
    /// Serial of the event
    pub serial: Serial,
}

/// Relative pointer motion event
#[derive(Debug, Clone)]
pub struct RelativeMotion {
    /// Motional vector
    pub delta: Point<f64, Logical>,
    /// Unaccelerated motion vector
    pub delta_unaccel: Point<f64, Logical>,

}

/// Pointer motion event
struct MotionEvent {
    pub absolute: Option<AbsoluteMotion>,
    pub relative: Option<RelativeMotion>,
    /// Timestamp in microseconds
    pub utime: u64,
}

wlroots has a separate wlr_seat_pointer_notify_frame function. Making frame calls explicit like that is also a possibility.

@Drakulix
Copy link
Member

Given we had some issues in the past with grouping axis-events, uncertainty where pointer gestures fit here and now the relative-pointer protocol, we might want to consider making frame explicit. That would also play nice with any further protocols relying on this event.

ids1024 added a commit to ids1024/smithay that referenced this issue Sep 19, 2023
Input handling in compositors will have to emit this appropriatly. But
then other methods don't have to map perfectly to frames.

Meant to address Smithay#1126.
ids1024 added a commit to ids1024/smithay that referenced this issue Sep 21, 2023
Input handling in compositors will have to emit this appropriatly. But
then other methods don't have to map perfectly to frames.

Meant to address Smithay#1126.
ids1024 added a commit to ids1024/smithay that referenced this issue Sep 21, 2023
Input handling in compositors will have to emit this appropriatly. But
then other methods don't have to map perfectly to frames.

Meant to address Smithay#1126.
ids1024 added a commit to ids1024/smithay that referenced this issue Sep 21, 2023
Input handling in compositors will have to emit this appropriatly. But
then other methods don't have to map perfectly to frames.

Meant to address Smithay#1126.
ids1024 added a commit to ids1024/smithay that referenced this issue Sep 21, 2023
Input handling in compositors will have to emit this appropriatly. But
then other methods don't have to map perfectly to frames.

Meant to address Smithay#1126.
@ids1024 ids1024 closed this as completed Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants