News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

r5843 sdl cursor fix

Started by kierongreen, July 30, 2012, 05:44:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kierongreen

The following problem was reported in IRC and confirmed by me in Linux:
In fullscreen mode right-dragging the map and world view would only work every second time. A closer look showed that this was due to SDL not reporting rightmouse button down events in this case (right mouse button up events were still reported). This behaviour only occurred sometimes after calls to SDL_SetCursor.

This patch addresses this issue by changing the call in show_pointer(int yesno) from SDL_ShowCursor(yesno != 0) to SDL_SetCursor((yesno != 0) ? arrow : blank), where blank is a new cursor defined as a completely blank image.

As in my opinion this is more of a bug in SDL than Simutrans this is a bit of a hack, but it seems to be the only easy solution. It has not been tested on Windows and it would be useful to check whether this works correctly on Windows before committing it to trunk.

prissi

I had not problem using the normal routines. But since SDL comes in many flavour, could you please specify the SDL version, and the screen renderer? I could not reproduce it on XFCE.

kierongreen

SDL Version 1.2.15, running Debian Linux with LXDE (which uses openbox window manager). Other user who reported problem was using ubuntu 12.04 with gnome (they didn't specify SDL version). It's definitely an issue with some combination of SDL/Window Manager/Linux rather than Simutrans as there are still issues after you quit Simutrans (in this case left click isn't detected until you right click again). It also only occurs in fullscreen mode.

Dwachs

I saw the same problems with SDL under some openSUSE / Kde system. Kieron's patch fixes this. So it is worth including.
Parsley, sage, rosemary, and maggikraut.

prissi

Ok, is in. Somebody still needs to tell the SDL guys of this error.

Dwachs

There is already a bug report, which seems to be the same as 'ours':

http://bugzilla.libsdl.org/show_bug.cgi?id=1081

It is marked fixed - the fix is only incorporated in a release that never got released (1.3).
Parsley, sage, rosemary, and maggikraut.

kierongreen

In which case we are likely to have to wait until SDL 2 is finalised, stable and incorporated into distributions to see it fixed...