New grab API
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 5 Jan 2012 02:27:26 +0000 (21:27 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 6 Jan 2012 16:30:08 +0000 (11:30 -0500)
commit5ffe9f470829a80acb711950eaa3870ec20c1057
tree756eaee9f570877e01c56d5904aec432fec65050
parent44b529f2e4b953206908f73842ca76d246f715d0
New grab API

This commit changes the way struct wl_grab works in a couple of ways:

 - The grab itself now decides when it ends instead of hardcoding button
   up as the terminating event.  We remove the end vfunc since a grab now
   always know when it ends and can just clean up at that point.

 - We add a new focus vfunc that is invoked every time the pointer enters
   a new surface, regardless of any grabs.  The callback receives the
   surface and the surface-relative pointer coordinates.  The callback lets
   a grab send enter/leave events and change the grab focus.

 - The grab has a focus surface, wich determines the coordinate space
   for the motion callback coordinates.

 - The input device always tracks the current surface, ie the surface that
   currently contains the pointer, and coordinates relative to that surface.

With these changes, we will be able to pull the core input event delivery
and the drag and drop grab into the core wayland-server library.
src/wayland-server.c
src/wayland-server.h