[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mouse / X problems UPDATE



Chris Owen wrote:

I have now found a solution for this mouse problem in X: it seems gpm was the problem. After uninstalling gpm, the PS/2 mouse now works correctly in X. If anyone can tell me why this is, or whether there's a workaround which lets me keep gpm, that would be interesting (although to be honest I'm not that bothered about needing gpm...).

Thanks
Chris


From a posting earlier in the day (subj: MOUSE won't function):

gpm is a mouse driver for the text-only virtual console. For example, if you are not running X, and you only have text-only virtual consoles (hereafter referred to as VTs, for Virtual Terminals), and you need a mouse in your VTs, then you'd need to be running gpm. Or even if you are running X, but you occasionally need to pop out to a VT and need a mouse while there, you'd need gpm running.

Now, if you have X running, X needs a mouse. It has its own mouse driver built-in. This mouse driver conflicts with gpm, and having gpm running as well as X can cause the mouse to behave erratically, etc. For example, the mouse might generate some events, such as "I've moved left", followed by "I've moved up". If both gpm and the X mouse driver are reading the mouse port, it may be that gpm reads the "left" event, removing that event from the incoming data stream, and then it comes X's turn to read the mouse events, and it reads "up", never getting a chance to read the "left" event because gpm "took" it. So the mouse behaviour in X was supposed to be left, then up, but turns out to be only up. Doh!

Thankfully, these two mouse drivers can be convinced to play nicely together. The way this is done is to tell gpm to not keep the incoming data to itself, but to repeat that incoming data, in a "raw" format. Both gpm and X normally read from the "incoming mouse data port" (whatever that is, perhaps /dev/psaux, perhaps /dev/ttyS0, etc). gpm can't repeat the data it reads back to that port, or next time it goes to read that port it'll just re-read what it read earlier, and loopity-loop. So instead it repeats the data to a special "virtual" port, called /dev/gpmdata. Then X needs to be configured to read its incoming mouse data, not from the normal port, but from the /dev/gpmdata "port". Voila! gpm and X now get along just dandy.

So, you have two options.

1) Remove gpm, and just get the mouse working in X

2) Configure gpm to repeat the raw data (run gpmconfig and answer the questions), and configure X to read its mouse data from /dev/gpmdata.




Reply to: