-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Support X11 through the XInputExtension
version 2.2 interface.
Some attempts have been made to introduce this into octotablet
- as of now, I have some rudimentary tablet device capabilities listing - however I have repeatedly run into a fundamental issue: xlib
and xcb
are extraordinarily stateful. Snooping on and snatching events from a given windowing interface (i.e. winit, sdl2) through their Display
pointer is a deeply fragile process due to this shared and unsynchronized state. Often times, winit
will unpredictably panic (understandably!) due to the tiniest meddling.
The two solutions I have thought of are:
-
Snoop events through
XCheckMaskEvent
. This requires octotablet to have priority control over the shared state than the windowing API that actually owns it, and could break some things. (E.g., winit would no longer sendDeviceEvent
s.) It also ends up being super fragile on account of that shared state, like event masks and error messages, which would need to be repeatedly context-switched by octotablet unbeknownst to the window owner. If the window owner is multi-threaded (though I can't think of any that are), this is a total nonstarter. -
Have octotablet manage it's own connection to the same server, snooping on the user window's (or possibly the root window's) events - similar to what the Wayland integration does. As far as I know, this is allowable under X. This also allows octotablet to be asynchronous in relation to the window and agnostic across Xcb or Xlib client implementations. Trouble here is I do not know of any way to reliably duplicate and Xlib or Xcb server connection in this way - just assuming the display comes from the default environment is a 99% solution but still not technically correct.