From 89153eb7249ee3bbcf51eb2759ceec8dc6a205b3 Mon Sep 17 00:00:00 2001 From: icicle Date: Tue, 27 Oct 2009 18:42:33 +0000 Subject: [PATCH] TG: Implement setMouseLocation:onScreen git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@28898 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/x11/XGServerWindow.m | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index b04097b..1d418cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-25 Thomas Gamper + + * Source/x11/XGServerWindow.m + Implement setMouseLocation:onScreen:. + 2009-10-25 Thomas Gamper * Source/x11/XGGLContext.m diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index 7564e8e..21ba16d 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -3653,6 +3653,19 @@ static BOOL didCreatePixmaps; grab_window = NULL; } +- (void) setMouseLocation: (NSPoint)mouseLocation onScreen: (int)aScreen +{ + int height; + int destX, destY; + + height = DisplayHeight(dpy, aScreen); + destY = height - mouseLocation.y; + destX = mouseLocation.x; + + XWarpPointer(dpy, None, [self xDisplayRootWindowForScreen: aScreen], + 0, 0, 0, 0, destX, destY); +} + - (void) setinputfocus: (int)win { gswindow_device_t *window = WINDOW_WITH_TAG(win);