From: Griffon26 <gri...@ly...> - 2002-10-02 16:45:52
|
I have found that vegastrike does not handle mouse input correctly when using xinerama. Neither does Quake2 for that matter, but I'm not entirely certain whether xlib, SDL or the game is to blame. Here's the situation. My smaller monitor (res 800x600) is left of my larger monitor (1280x1024), the one I'm using for vegastrike. When I move my mouse in any direction in vegastrike, it will react as if I moved my mouse to the right at incredible speed. Because vegastrike cvs is currently not compiling, I debugged the problem with the Q2 source. I will assume that this is just as useful in locating the bug since the behaviour is identical. Turns out that Quake is first grabbing the pointer with XGrabPointer after which it warps it to (0,0) with XWarpPointer. Say the left border of the window is at 200 on this screen (1000 in total if you take both screens as one). This warp is supposed to be to a position relative to the upper left corner of the window, but for some reason consecutive calls to XNextEvent return XMotionEvents containing x values ranging from -203 to -197, which would indicate the pointer was warped to the top-left of the 1280 screen. In the quake source I see that they add the x coordinate of the window to this value to get something that hovers around 0. And that's where the problem is. The x coordinate of the window is obtained by interpreting the CreateNotify event which returns not 200 (relative position to the left edge of the 1280 screen) but 1000 (relative to the entire xinerama screen). As a result the value does not hover around 0 but around 800 causing any movement to be interpreted as an extreme movement to the right. As I said I'm not sure whether xlib, SDL or the game is to blame here, but I hope there will be some of you who can help me find out. Griffon26 P.S.: Off topic, I have been able to compile the thing and run it with gcc 3.2, so if anyone's interested to know what has to be changed to do this, just let me know. P.S.: Could someone take a look at the changes I proposed earlier and see if they affect the compilation with other compilers and maybe change them in the archive if they don't. I'd really like to build vegastrike with gcc 3.2 straight from cvs =] |