FS#3758 - Mouse cursor jumps to bottom right when clicking in fullscreen mode

Attached to Project: OpenTTD
Opened by Raf Geens (rafgeens) - Sunday, 11 April 2010, 18:54 GMT
Last edited by Remko Bijker (Rubidium) - Thursday, 13 May 2010, 15:14 GMT
Type External
Category Interface
Status Closed
Assigned To No-one
Operating System Linux
Severity Medium
Priority Normal
Reported Version 1.0.0
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
  • Bilbo (bilbo) (2010-04-18)
Private No


Machine: Dell Latitude E6400
OS: Ubuntu 9.10
Kernel: 2.6.31-21

I can control my cursor using a trackpoint and touchpad that are part of the laptop, or using a wireless usb mouse. When using the trackpoint and the touchpad, everything works fine. When using the wireless mouse and clicking anywhere while in fullscreen mode, the cursor disappears. Moving it will cause it to appear from the bottom right corner of the screen.
This task depends upon

Closed by  Remko Bijker (Rubidium)
Thursday, 13 May 2010, 15:14 GMT
Reason for closing:  Bug in external library
Comment by Remko Bijker (Rubidium) - Sunday, 11 April 2010, 22:05 GMT
I doubt the problem is in OpenTTD for the simple reason that we use a library for all mouse stuff. This library tells us where the mouse moved to and such OpenTTD behaves the same *if* OpenTTD gets the same input. It looks like it is somewhere in either X or SDL (the library we use for mouse, sound and video).
Comment by Remko Bijker (Rubidium) - Saturday, 17 April 2010, 11:46 GMT
  • Field changed: Status (New → Waiting on reporter)
Does this happen if you build a version with Allegro and then use Allegro for as video driver for OpenTTD?
Comment by Raf Geens (rafgeens) - Saturday, 17 April 2010, 13:04 GMT
It doesn't reproduce in the Allegro version.
Comment by Raf Geens (rafgeens) - Saturday, 17 April 2010, 13:07 GMT
My SDL version is 1.2.13-4ubuntu.
Comment by Raf Geens (rafgeens) - Saturday, 17 April 2010, 13:38 GMT
Also reproduces when using SDL 1.2.14 on Linux. No problems in the OpenTTD Windows version on the same machine.
Comment by Remko Bijker (Rubidium) - Saturday, 17 April 2010, 14:37 GMT
  • Field changed: Type (Bug → External)
  • Field changed: Status (Waiting on reporter → Not confirmed)
Given that it works fine with Allegro, OpenTTD only "sees" one mouse in both SDL and Allegro and because the other mice work, I can only conclude that this is an error related to SDL or at least the interaction of SDL with X/the mouse drivers.
Comment by Bilbo (bilbo) - Sunday, 18 April 2010, 23:12 GMT
I encountered similar bug recently - mouse cursor disappear when I click into OpenTTD window (I can still click and cause actions, but I can't see the pointer) and reappear if I move the mouse outside OpenTTD window and then back inside.

I am using Debian sid (unstable), x86_64 architecture

It is both in 1.0.0 and in nightly, but I guess that at least partial cause of the problem is upgrading some of my X server packages, since few days ago it worked normally and I haven't recompiled affected binaries since then.

I dug out OpenTTD 0.6.3 compiled about 1.5 years ago and it suffers from same problem.

Seems to be SDL or other libraries issue, though the question is if we can do something with it. Is it bug in the library or is OpenTTD using the library in a wrong way that happen to work until now?

I have SDL: libsdl1.2debian - version 1.2.14-5
Comment by Remko Bijker (Rubidium) - Monday, 19 April 2010, 10:02 GMT
I've not encountered this bug yet, but I don't have 1.2.14-5 yet... lets try updating to that and see the difference.
Okay, upgrading to 1.2.14-5 does not give me that bug, so it isn't in SDL *or* it is something between SDL, the window manager and X. I'm using XFCE's window manager.

Does reverting libsdl to 1.2.14-4 fix the issue? 1.2.14-5 seems to have changed the code for mouse handling somewhat.

Given that Wesnoth worked with 1.2.13 and so did OpenTTD, Wesnoth being broken by 1.2.14, fixed by 1.2.14-5 which possibly broke OpenTTD... something is really messed up there. is the bug report about Wesnoth being broken.
Comment by Bilbo (bilbo) - Monday, 19 April 2010, 10:28 GMT
I tried downgrading libsdl from 1.2.14-5 to 1.2.14-4+b1 and it fixed the issue for me.
Comment by Bilbo (bilbo) - Monday, 19 April 2010, 10:40 GMT
As for the window manager - I am using fluxbox version 1.1.1-7
Comment by Remko Bijker (Rubidium) - Monday, 19 April 2010, 11:00 GMT
Then I'd please file a bug report against libsdl 1.2.14-5 breaking OpenTTD mentioning that it seems to work with XFCE's window manager, but fails with fluxbox, and that 1.2.14-4(+b1) works.
Comment by Bilbo (bilbo) - Monday, 19 April 2010, 14:51 GMT Comment by Remko Bijker (Rubidium) - Monday, 19 April 2010, 14:59 GMT
Thanks Bilbo.

To bad this can't be the cause for Raf Geens' problem. Maybe upgrading SDL for him helps, but I fear that that would imply upgrading Ubuntu 9.10 to 10.04 (beta?), which is quite a big step.
Comment by frosch (frosch) - Monday, 19 April 2010, 18:36 GMT
Just to add: On gentoo with xfce4 Bilbo's issue is also encountered between 1.2.14-r1 and 1.2.14-r2 (gentoo versions, don't confuse with debian's), which differ just by the mentioned Wesnoth-related patch.
Comment by Raf Geens (rafgeens) - Monday, 19 April 2010, 18:47 GMT
Well, I tested it by building the latest 1.2.14 stable from SDL's site and linking OpenTTD to that, which alas didn't help. I do intend to upgrade to 10.04 when it's released, so I'll check in it then.
Comment by Raf Geens (rafgeens) - Thursday, 13 May 2010, 15:09 GMT
When using Ubuntu 10.04 and OpenTTD 1.0.1, the problem is gone.
Comment by Remko Bijker (Rubidium) - Thursday, 13 May 2010, 15:14 GMT
So it is/was an SDL issue.