[PATCH xwayland 0/7] Fixes for warp/confinement emulation on Wine games

Carlos Garnacho carlosg at gnome.org
Sat Nov 12 16:25:15 UTC 2016


Hey,

Here's some assorted fixes to make Xwayland pointer locking/confinement
emulation work on games run through Wine. Some specifics:

 - Wine pretty much forwards win32 parlance to X11 equivalents, if a game
   calls ClipCursor, Wine calls XGrabPointer with a confineTo. If a game
   calls SetCursorPos, Wine calls XWarpPointer. How each game achieves what
   it wants is pretty much up to their devices.
 - Wine happens to grab the pointer on an InputOnly window covering the
   rectangle passed in ClipCursor (in screen coords). This is funky because
   hw/xwayland/ has not much knowledge of InputOnly windows, and because
   it might happen to be outside any coordinates Xwayland can receive events
   from. For the cases we want to cover here, it should be expected that the
   clipping area matches the visible window.
 - Wine happens to warp on the root window, presumably because the equivalent
   win32 call just takes a position in screen coordinates. The same
   considerations about coordinates outside the pointer focus happen
   here, and again a meaningful behavior should be expected for the cases we
   want to cover.

Of the whole series, perhaps the most controversial patch is 5/7, as it involves
a change in the current policy about when to send events through the relative
pointer, but IMHO still a sound one.

6/7 and 7/7 are rather miscellaneous, but I found these during the doing of
these patches.

Cheers,
  Carlos


Carlos Garnacho (7):
  dix: assume warping on the RootWindow always happens on visible coords
  xwayland: Allow pointer warp on the root window
  xwayland: "Accept" confineTo on InputOnly windows
  xwayland: Update root window size when desktop size changes
  xwayland: Emit relative motion events on both warp/confinement
    situations
  Xi: Use WarpPointerProc hook on XI pointer warping implementation
  xwayland: Remove two unused proc pointers.

 Xi/xiwarppointer.c            |  4 ++++
 dix/events.c                  |  2 +-
 hw/xwayland/xwayland-input.c  | 39 ++++++++++++++++-----------------------
 hw/xwayland/xwayland-output.c |  1 +
 hw/xwayland/xwayland.c        | 12 +++++++++++-
 hw/xwayland/xwayland.h        |  2 --
 6 files changed, 33 insertions(+), 27 deletions(-)

-- 
2.9.3



More information about the xorg-devel mailing list