xrestrict icon indicating copy to clipboard operation
xrestrict copied to clipboard

How to best allow interactive session selection?

Open Ademan opened this issue 11 years ago • 1 comments
trafficstars

If a user uses xrestrict to confine their tablet to their left screen, and later wants to confine it to their right screen, they cannot do this. This is because interactive selection requires they be able to click on the right screen, but they've already confined themselves to their left screen.

To work around this, a user may unplug and replug their device but that is ugly.

xrestrict could reset all "Coordinate Transformation Matrix"s to identity prior to grabbing pointers, but that potentially munges state the user may wish to keep. In practice I believe this to be acceptable though, as tablets seem to be the most common type of device with absolute X and Y axes, and it seems unlikely a user would have two connected at once. Therefore the following procedure ought to be good enough:

  1. Find all devices with absolute X and Y axes with non-identity "Coordinate Transformation Matrix"s.
  2. Remember these matrices
  3. Reset all matrices to identity
  4. Perform grab
  5. Re-apply all matrices
  6. Apply xrestrict matrix

Ademan avatar Nov 12 '14 06:11 Ademan

Implemented something similar to what is described here (and in #16 ) in 359792aa146627e04a2275c275eb5c9f6bf687ce Best user experience is still open to discussion.

Ademan avatar Nov 24 '14 04:11 Ademan