mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-23 04:23:08 +00:00
- Add patch to solve slow mouse movement on low FPS
- Add forgotten USE_LDCONFIG Obtained from: sourceforge tracker Approved by: miwi (mentor)
This commit is contained in:
parent
2ea2f9e958
commit
1c3885a80e
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=215602
@ -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"
|
||||
|
||||
|
82
devel/ois/files/patch-src-linux-LinuxMouse.cpp
Normal file
82
devel/ois/files/patch-src-linux-LinuxMouse.cpp
Normal file
@ -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 )
|
||||
|
Loading…
Reference in New Issue
Block a user