diff options
author | amdmi3 <amdmi3@FreeBSD.org> | 2008-06-23 18:23:14 +0800 |
---|---|---|
committer | amdmi3 <amdmi3@FreeBSD.org> | 2008-06-23 18:23:14 +0800 |
commit | d5a22d20524c0d1c8c49ae7714219dd24b187378 (patch) | |
tree | ecc31995665da99f0717ba46a93ba347ef28963a /devel | |
parent | 6c74f7d9de05b1a137c59863bde927109602edd2 (diff) | |
download | freebsd-ports-gnome-d5a22d20524c0d1c8c49ae7714219dd24b187378.tar.gz freebsd-ports-gnome-d5a22d20524c0d1c8c49ae7714219dd24b187378.tar.zst freebsd-ports-gnome-d5a22d20524c0d1c8c49ae7714219dd24b187378.zip |
- Add patch to solve slow mouse movement on low FPS
- Add forgotten USE_LDCONFIG
Obtained from: sourceforge tracker
Approved by: miwi (mentor)
Diffstat (limited to 'devel')
-rw-r--r-- | devel/ois/Makefile | 2 | ||||
-rw-r--r-- | devel/ois/files/patch-src-linux-LinuxMouse.cpp | 82 |
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, ¤t_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 ) + |