Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@creichen
Copy link
Owner

xinput2_device_is_pen() was testing against default-zero values in the X11 selector cache on at least the first round of detections, leading to imprecise detection.

Description

The patch fixes two aspects of initialisation:

  1. Ensure that the selector cache is always initialised before any calls to xinput2_device_is_pen() by adding a call to pen_atoms_ensure_initialized() into X11_InitPen(). That new call also control-dominates all of the other calls to
    pen_atoms_ensure_initialized(), so they are no longer needed.

  2. Ensure that all X11 Atoms used in SDL_x11pen.c are instantiated if missing. This ensures that they are never None and avoids potential failures to detect hot-plugged tablet devices.

Existing Issue(s)

Might fix libsdl-org#8611

xinput2_device_is_pen() was testing against default-zero values in the
X11 selector cache on at least the first round of detections, leading
to imprecise detection.

The patch fixes two aspects of initialisation:

1. Ensure that the selector cache is always initialised before any
calls to xinput2_device_is_pen() by adding a call to
pen_atoms_ensure_initialized() into X11_InitPen().  That new call also
control-dominates all of the other calls to
pen_atoms_ensure_initialized(), so they are no longer needed.

2. Ensure that all X11 Atoms used in SDL_x11pen.c are instantiated if
missing.  This ensures that they are never `None` and avoids potential
failures to detect hot-plugged tablet devices.
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.

Mouse clicks not reported because mouse is misdetected as a pen

2 participants