aboutsummaryrefslogtreecommitdiff
path: root/devel/ois
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2008-06-23 10:23:14 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2008-06-23 10:23:14 +0000
commit1c3885a80e4adc9d5bba8b42c553b8ca63230e8e (patch)
tree29a0083fd725046ce4c7bee186f37edc4c93c105 /devel/ois
parent2ea2f9e958116424f0113416e4987e08e5565f97 (diff)
downloadports-1c3885a80e4adc9d5bba8b42c553b8ca63230e8e.tar.gz
ports-1c3885a80e4adc9d5bba8b42c553b8ca63230e8e.zip
Notes
Diffstat (limited to 'devel/ois')
-rw-r--r--devel/ois/Makefile2
-rw-r--r--devel/ois/files/patch-src-linux-LinuxMouse.cpp82
2 files changed, 84 insertions, 0 deletions
diff --git a/devel/ois/Makefile b/devel/ois/Makefile
index 7c6f175c9270..5c12df0015cc 100644
--- a/devel/ois/Makefile
+++ b/devel/ois/Makefile
@@ -7,6 +7,7 @@
PORTNAME= ois
PORTVERSION= 1.2.0
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= SF
MASTER_SITE_SUBDIR= wgois
@@ -20,6 +21,7 @@ USE_GMAKE= yes
USE_GNOME= gnomehack
USE_AUTOTOOLS= libtool:15:env aclocal:19:env autoheader:261:env automake:19:env autoconf:261:env
USE_XORG= x11 xaw
+USE_LDCONFIG= yes
CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib" CPPFLAGS="-I${LOCALBASE}/include"
diff --git a/devel/ois/files/patch-src-linux-LinuxMouse.cpp b/devel/ois/files/patch-src-linux-LinuxMouse.cpp
new file mode 100644
index 000000000000..5a6a551d2731
--- /dev/null
+++ b/devel/ois/files/patch-src-linux-LinuxMouse.cpp
@@ -0,0 +1,82 @@
+--- src/linux/LinuxMouse.cpp (revision 1090)
++++ src/linux/LinuxMouse.cpp (working copy)
+@@ -156,29 +156,28 @@
+ char mask[4] = {0,1,4,2};
+ XEvent event;
+
+- //Poll x11 for events mouse events
+- while( XPending(display) > 0 )
++ Window u1; int u2;
++ Window current_win;
++ int x, y;
++ unsigned int mmask;
++
++ if (XQueryPointer(display, window, &u1, &current_win, &u2, &u2, &x, &y, &mmask))
+ {
+- XNextEvent(display, &event);
+-
+- if( event.type == MotionNotify )
+- { //Mouse moved
+- //Ignore out of bounds mouse if we just warped
+- if( mWarped )
+- {
+- if(event.xmotion.x < 5 || event.xmotion.x > mState.width - 5 ||
+- event.xmotion.y < 5 || event.xmotion.y > mState.height - 5)
+- continue;
+- }
+-
++ //Ignore out of bounds mouse if we just warped
++ if(mWarped && (x < 5 || x > mState.width - 5 || y < 5 || y > mState.height - 5))
++ {
++ // ignored
++ }
++ else if (!(oldXMouseX == x && oldXMouseY == y))
++ {
+ //Compute this frames Relative X & Y motion
+- mState.X.rel = event.xmotion.x - oldXMouseX;
+- mState.Y.rel = event.xmotion.y - oldXMouseY;
+-
++ mState.X.rel = x - oldXMouseX;
++ mState.Y.rel = y - oldXMouseY;
++
+ //Store old values for next time to compute relative motion
+- oldXMouseX = event.xmotion.x;
+- oldXMouseY = event.xmotion.y;
+-
++ oldXMouseX = x;
++ oldXMouseY = y;
++
+ mState.X.abs += mState.X.rel;
+ mState.Y.abs += mState.Y.rel;
+
+@@ -198,8 +197,8 @@
+ if( mouseFocusLost == false )
+ {
+ //Keep mouse in window (fudge factor)
+- if(event.xmotion.x < 5 || event.xmotion.x > mState.width - 5 ||
+- event.xmotion.y < 5 || event.xmotion.y > mState.height - 5 )
++ if(x < 5 || x > mState.width - 5 ||
++ y < 5 || y > mState.height - 5 )
+ {
+ oldXMouseX = mState.width >> 1; //center x
+ oldXMouseY = mState.height >> 1; //center y
+@@ -210,8 +209,16 @@
+ }
+ mMoved = true;
+ }
+- else if( event.type == ButtonPress )
+- { //Button down
++ }
++
++
++ //Poll x11 for events mouse events
++ while( XPending(display) > 0 )
++ {
++ XNextEvent(display, &event);
++
++ if( event.type == ButtonPress )
++ { //Button down
+ static_cast<LinuxInputManager*>(mCreator)->_setGrabState(true);
+
+ if( event.xbutton.button < 4 )
+