[osx] Update events to floating point coordinates

The event translation code should be using the float type for
coordinates.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1725

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
Michael Mortensen 2009-07-26 20:13:36 +01:00 committed by Emmanuele Bassi
parent 13f32cb3b9
commit 2c2f31b1be

View File

@ -40,7 +40,7 @@ static GPollFunc old_poll_func = NULL;
@interface NSEvent (Clutter) @interface NSEvent (Clutter)
- (gint)clutterTime; - (gint)clutterTime;
- (gint)clutterButton; - (gint)clutterButton;
- (void)clutterX:(gint*)ptrX y:(gint*)ptrY; - (void)clutterX:(gfloat*)ptrX y:(gfloat*)ptrY;
- (gint)clutterModifierState; - (gint)clutterModifierState;
- (guint)clutterKeyVal; - (guint)clutterKeyVal;
@end @end
@ -62,13 +62,13 @@ static GPollFunc old_poll_func = NULL;
} }
} }
- (void)clutterX:(gint*)ptrX y:(gint*)ptrY - (void)clutterX:(gfloat*)ptrX y:(gfloat*)ptrY
{ {
NSView *view = [[self window] contentView]; NSView *view = [[self window] contentView];
NSPoint pt = [view convertPoint:[self locationInWindow] fromView:nil]; NSPoint pt = [view convertPoint:[self locationInWindow] fromView:nil];
*ptrX = (gint)pt.x; *ptrX = pt.x;
*ptrY = (gint)pt.y; *ptrY = pt.y;
} }
- (gint)clutterModifierState - (gint)clutterModifierState
@ -199,7 +199,7 @@ clutter_event_osx_translate (NSEvent *nsevent, ClutterEvent *event)
case NSOtherMouseDragged: case NSOtherMouseDragged:
event->type = CLUTTER_MOTION; event->type = CLUTTER_MOTION;
[nsevent clutterX:(&event->motion.x) y:&(event->motion.y)]; [nsevent clutterX:&(event->motion.x) y:&(event->motion.y)];
event->motion.modifier_state = [nsevent clutterModifierState]; event->motion.modifier_state = [nsevent clutterModifierState];
CLUTTER_NOTE (EVENT, "motion %d at %d,%d", CLUTTER_NOTE (EVENT, "motion %d at %d,%d",