Bug: SDL_Warpmouse + fullscreen

Sam, et al,

SWL_Warpmouse doesn’t work as expected on a full screen DGA display which
is larger than the SDL video surface (or indeed any fullscreen)
e.g. 800x600 screen for 640x480 surface.

I’ve looked at this a bit, and spotted in src/video/x11/SDL_sysmouse.c

void X11_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
{
if ( (this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {

SDL_PrivateMouseMotion(0,0,this->screen->w/2,this->screen->h/2);

}

As you can see, the (x,y) args get totally ignored! I’ve tried to fix this with
the obvious:

    SDL_PrivateMouseMotion(0,0,x,y);

but that then hits the problem that SDL doesn’t take into account where
the SDL surface begins inside the larger X11 DGA display. You really need

       SDL_PrivateMouseMotion(0,0,
            DisplayWidth(SDL_Display, SDL_Screen) -
                (this->screen->w/2) + x,
            DisplayHeight(SDL_Display, SDL_Screen) -
                (this->screen->h/2) + y);

but this screws up everything because SDL doesn’t expect co-ordinates
outwith the display… 8(

It seems that the MoveCursor routine needs some kind of magic to take into
account where the SDL surface begins…

The obvious question is, why has noone else seen this? Does noone else use
fullscreen for their games?

So two bugs:

  1. x,y ignored in SDL_WarpMouse
  2. SDL surface start not taken into account for lorger displays

Neil–

Neil McGill mailto:Neil_McGill *8^) . .
Software Developer:ISDN, Cisco Systems Ltd ~~""~""~"~"|~"~
3rd Floor, 96 Commercial Street, Edinburgh, EH6 6LX, UK ||| |||
Tel: 0131 561 3622 Fax: 0131 561 3601 Mob: 07714 226 281 .:|||||:.:|||||:.