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

Pointer sanitization - x11, udev #17281

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

zoltanvb
Copy link
Contributor

Description

Adapt the sanitized pointer handling, discussed at #17196 :

X11 driver specific changes:

  • make sure pointer position is always within [-0x7fff,0x7fff] by using the confined wrapper
  • remove extra "inside" checks, general simplification
  • enable pointer offscreen reporting

Udev driver specific changes:

  • remove custom calculation and use common viewport translation
  • unify pointer query instead of separate _x and _y
  • enable pointer offscreen reporting

Other changes:

  • more tuning of pointer conversion in video_driver.c for edges
  • lightgun button ID conversion moved to input_driver.c (same calculation is repeated in several input drivers)

Tests done: remote retropad in an X11 desktop (x11, udev), fullscreen/windowed, mouse grab/no grab, pointer/lightgun combinations, and also in KMS mode (udev). Reporting off-window events could be probably refined a bit (on Wayland it is more smooth), but this PR does not change the behavior in that respect.

Related Pull Requests

#17169
#17169 (comment)

Adapt the sanitized pointer handling, discussed at libretro#17196 :

X11 driver specific changes:

    make sure pointer position is always within [-0x7fff,0x7fff] by using the confined wrapper
    remove extra "inside" checks, general simplification
    enable pointer offscreen reporting

Udev driver specific changes:

    remove custom calculation and use common viewport translation
    unify pointer query instead of separate _x and _y
    enable pointer offscreen reporting

Other changes:

    more tuning of pointer conversion in video_driver.c for edges
    lightgun button ID conversion moved to input_driver.c
@LibretroAdmin LibretroAdmin merged commit 6a85844 into libretro:master Dec 24, 2024
27 checks passed
Sunderland93 pushed a commit to Sunderland93/RetroArch that referenced this pull request Dec 26, 2024
Adapt the sanitized pointer handling, discussed at libretro#17196 :

X11 driver specific changes:

    make sure pointer position is always within [-0x7fff,0x7fff] by using the confined wrapper
    remove extra "inside" checks, general simplification
    enable pointer offscreen reporting

Udev driver specific changes:

    remove custom calculation and use common viewport translation
    unify pointer query instead of separate _x and _y
    enable pointer offscreen reporting

Other changes:

    more tuning of pointer conversion in video_driver.c for edges
    lightgun button ID conversion moved to input_driver.c
@Kelvfimer
Copy link

This PR create a bad behaviour with mayflash and wiimotes issue raised #17338 pls can you take a look into it? thx

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

Successfully merging this pull request may close these issues.

3 participants