SDL_WM_GrabInput() problem on MacOSX10.4

Hello

I have tried SDL 1.2.8 on tiger(macosx10.4) and I can’t get
SDL_WM_GrabInput() to work on fullscreen mode. It works with previous
macos version 10.3 and with 10.4 if not fullscreen.

The call
SDL_WM_GrabInput(SDL_GRAB_ON)
returns SDL_GRAB_OFF and I don’t receive mouse relative positions
beyond screen edege.

I got this even with this simple code which works on 10.3 and 10.4 not
fullscreen-------------------------------------
SDL_Init(SDL_INIT_VIDEO);
SDL_Surface *screen = NULL;
screen=SDL_SetVideoMode(800,600,32,SDL_DOUBLEBUF|SDL_FULLSCREEN);
err=SDL_WM_GrabInput(SDL_GRAB_ON);
if (err == SDL_GRAB_ON) {
printf(“Grab OK”);
} else {
printf(“Grab Fails [%d %d]\n”,err,SDL_GRAB_OFF);
}
SDL_ShowCursor(SDL_DISABLE);

Do I forget something?
Could someone confirm that this should work?

Thanks


Mikel

The call
SDL_WM_GrabInput(SDL_GRAB_ON)
returns SDL_GRAB_OFF and I don’t receive mouse relative positions beyond
screen edege.

The example worked here (rather, the following code did; I added the
extra junk to get it to compile). I used the CVS version on MacOS
10.4.1. Could it be that it’s either broken in 1.2.8, or you’re not
using the version you think you are?

–ryan.

#include “SDL.h”

int main(int argc, char **argv)
{
SDL_Init(SDL_INIT_VIDEO);
SDL_Surface
*screen=SDL_SetVideoMode(800,600,32,SDL_DOUBLEBUF|SDL_FULLSCREEN);
SDL_GrabMode err=SDL_WM_GrabInput(SDL_GRAB_ON);
if (err == SDL_GRAB_ON) {
printf(“Grab OK”);
} else {
printf(“Grab Fails [%d %d]\n”,err,SDL_GRAB_OFF);
}
SDL_ShowCursor(SDL_DISABLE);

 /* stall for 10 seconds */
 while (SDL_GetTicks() < 10000) {
     SDL_Event e;
     while (SDL_PollEvent(&e)) {}
     SDL_Delay(10);
 }

 SDL_Quit();
 return(0);

}

El 08/06/2005, a las 2:42, Ryan C. Gordon escribi?:

The call
SDL_WM_GrabInput(SDL_GRAB_ON)
returns SDL_GRAB_OFF and I don’t receive mouse relative positions
beyond screen edege.

The example worked here (rather, the following code did; I added the
extra junk to get it to compile). I used the CVS version on MacOS
10.4.1. Could it be that it’s either broken in 1.2.8, or you’re not
using the version you think you are?

You are right :slight_smile:

I thought was using 1.2.8 (and it was installed on the system) but I
had an older one on my ~/Library and was linkning to that :frowning:
Of course I didn’t noticed it till I built the version from CVS and
tried to install. :slight_smile:
Both the package from libsdl.org and cvs one work now

Thank you
I’ll try to ask something harder next time :-)-----------------------------
Mikel