Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: wrong cursor position (linux)  (Read 662 times)

devalex

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
wrong cursor position (linux)
« on: August 18, 2010, 03:50:10 PM »

I use svn version of OIS and uncomment next lines in OISConsole.cpp
Quote
//For this demo, show mouse and do not grab (confine to window)
//pl.insert(std::make_pair(std::string("x11_mouse_grab"), std::string("false")));
//pl.insert(std::make_pair(std::string("x11_mouse_hide"), std::string("false")));
I use linux(testing debian), and when i run demo(ConsolApp) i get next output:
Quote
MouseMoved: Abs(-6, 25, 0) Rel(-1, 6, 0)
But abs position of cursor can't be negative
Left top point position is (-6,-6) instead of (0,0)
If I comment lines again, it writes correct cursor position(Left top point position is (0,0))

How can I fix it?
Logged

devalex

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
Re: wrong cursor position (linux)
« Reply #1 on: August 18, 2010, 03:54:51 PM »

patch(works for me)
Quote
Index: LinuxMouse.cpp
===================================================================
--- LinuxMouse.cpp   (revision 17)
+++ LinuxMouse.cpp   (working copy)
@@ -50,7 +50,7 @@
    mWarped = false;
 
    //6 is just some random value... hardly ever would anyone have a window smaller than 6
-   oldXMouseX = oldXMouseY = 6;
+   oldXMouseX = oldXMouseY = 0;
    oldXMouseZ = 0;
 
    if( display ) XCloseDisplay(display);
Logged