diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-08 10:10:25 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-08 14:33:50 +1000 |
commit | 00bc043fa0398a1d14d46b87da2ff3031a9535dc (patch) | |
tree | 8d70096cc5a01aad34de7cd307096bec16e462b5 | |
parent | bae070914fc27db122e6131ae4838559c4a72f65 (diff) |
dix: export subpixel precision in XI2 events for root/event coordinates.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | dix/eventconvert.c | 4 | ||||
-rw-r--r-- | dix/getevents.c | 4 | ||||
-rw-r--r-- | include/events.h | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c index e51b8ec07..58fd6d2c2 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -385,8 +385,8 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi) xde->valuators_len = vallen; xde->deviceid = ev->deviceid; xde->sourceid = ev->sourceid; - xde->root_x = FP1616(ev->root_x, 0); - xde->root_y = FP1616(ev->root_y, 0); + xde->root_x = FP1616(ev->root_x, ev->root_x_frac); + xde->root_y = FP1616(ev->root_y, ev->root_y_frac); xde->mods.base_mods = ev->mods.base; xde->mods.latched_mods = ev->mods.latched; diff --git a/dix/getevents.c b/dix/getevents.c index 7aafc9828..30b2c69b6 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -44,6 +44,7 @@ #include "dixevents.h" #include "mipointer.h" #include "events.h" +#include "eventconvert.h" #include <X11/extensions/XKBproto.h> #include "xkbsrv.h" @@ -1070,9 +1071,10 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, event->detail.button = buttons; } - /* XXX: this should be 16.16 fixed point */ event->root_x = cx; /* root_x/y always in screen coords */ event->root_y = cy; + event->root_x_frac = pDev->last.remainder[0]; + event->root_y_frac = pDev->last.remainder[1]; set_valuators(pDev, event, first_valuator, num_valuators, valuators); diff --git a/include/events.h b/include/events.h index da8f58aaf..6803b5b7b 100644 --- a/include/events.h +++ b/include/events.h @@ -86,8 +86,10 @@ typedef struct uint32_t button; /**< Button number */ uint32_t key; /**< Key code */ } detail; - uint32_t root_x; /**< Pos relative to root window in 16.16 fixed pt */ - uint32_t root_y; /**< Pos relative to root window in 16.16 fixed pt */ + uint16_t root_x; /**< Pos relative to root window in integral data */ + float root_x_frac; /**< Pos relative to root window in frac part */ + uint16_t root_y; /**< Pos relative to root window in integral part */ + float root_y_frac; /**< Pos relative to root window in frac part */ uint8_t buttons[(MAX_BUTTONS + 7)/8]; /**< Button mask */ struct { uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */ |