From 2655062eb817b5d49ad6567a891cafb7170024ec Mon Sep 17 00:00:00 2001 From: tissoire Date: Fri, 21 Dec 2007 14:58:33 +0000 Subject: correction bug grab --- debian/changelog | 6 ++++++ debian/control | 2 +- src/ivypointer.c | 15 +++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 25df809..442f7d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ivypointer (0.0.3-0) unstable; urgency=low + + * Correction du bug relatif au grab + + -- Benjamin Tissoires Fri, 21 Dec 2007 15:52:30 +0100 + ivypointer (0.0.2-0) unstable; urgency=low * Ajout du mode wacom pour traiter les messages d'xinput_ivy diff --git a/debian/control b/debian/control index 4c83785..5af8c8c 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Priority: extra Section: unknown Maintainer: Benjamin Tissoires Build-Depends: debhelper (>> 4.0.0), libc6-dev, xlibs-dev | libx11-dev | xorg-dev, ivy-c-dev -Standards-Version: 0.0.2 +Standards-Version: 0.0.3 Package: ivypointer Section: unknown diff --git a/src/ivypointer.c b/src/ivypointer.c index 984ec43..e6b6f37 100644 --- a/src/ivypointer.c +++ b/src/ivypointer.c @@ -31,8 +31,8 @@ # include # if HAVE_X11_EXTENSIONS_XTEST_H # include -//# else -//# error The XTest extension is required to build xtest +# else +# error The XTest extension is required to build xtest # endif # if HAVE_X11_EXTENSIONS_XINERAMA_H // Xinerama.h may lack extern "C" for inclusion by C++ @@ -98,14 +98,13 @@ openDisplay(const char* displayName) // verify the availability of the XTest extension int majorOpcode, firstEvent, firstError; -#if HAVE_X11_EXTENSIONS_XTEST_H if (!XQueryExtension(display, XTestExtensionName, &majorOpcode, &firstEvent, &firstError)) { printf("XTEST extension not available"); XCloseDisplay(display); return NULL; } -#endif + XTestGrabControl(display, True); #if HAVE_XKB_EXTENSION { m_xkb = false; @@ -163,25 +162,25 @@ int valid(float x, float y) { void fakeMouseButton(const unsigned int xButton, Bool press) { -#if HAVE_X11_EXTENSIONS_XTEST_H if (xButton != 0) { XTestFakeButtonEvent(display, xButton, press ? True : False, 0); XFlush(display); } -#endif } void fakeMouseMove(int x, int y) { - XWarpPointer(display, None, RootWindow(display, 0), 0, 0, 0, 0, x, y); + XTestFakeMotionEvent(display, DefaultScreen(display), x, y, CurrentTime); + //XWarpPointer(display, None, RootWindow(display, 0), 0, 0, 0, 0, x, y); XFlush(display); } void fakeMouseRelativeMove(int dx, int dy) { - XWarpPointer(display, None, None, 0, 0, 0, 0, dx, dy); + XTestFakeRelativeMotionEvent(display, dx, dy, CurrentTime); + //XWarpPointer(display, None, None, 0, 0, 0, 0, dx, dy); XFlush(display); } -- cgit v1.1