Squishy thoughts — crazy in small doses

Chasing the mouse cursor

July 21, 2014

During my adventures with Compton and tearless videos I noticed something which at first just seemed a little odd. But I was busy trying to solve my tearing problem, so I didn’t really pay much attention to it at the time. Instead of blissfully forgetting this, my brain decided to queue the issue according to a complex set of rules that it has yet to make me privy to but which never fail to make me question how I ever get anything done.

To see what bothered me you can try running X with and without a compositor. When you run with compositing and move a window, the window and the mouse cursor aren’t perfectly matched up. It’s as if the window is chasing the mouse cursor. If you turn off the compositor and do the same thing you’ll see that the window and the mouse cursor are perfectly matched up.

Some probably think this is a silly thing to get hung up on, and it is. Then again, I’m a silly person so I decided to see if I could solve it. My hypothesis was that the compositor was one frame behind whatever was responsible for drawing the mouse cursor. After some googling I found a page about Wayland, the successor of X, which contained something relevant to my problem. In the list of reasons why you would want to switch to Wayland, it says:

eliminates lag between cursor and dragged windows (eg moving toplevels or dnd icons)

It also mentions that fixing these things in X are hard or impossible. I have no idea where this particular issue falls in the hard to impossible range, but since Wayland apparently will fix this, I’m perfectly okay with waiting.

Tags: linux