Cursor offset bug in OSX

Steps to reproduce :

  • Open a SDL app that uses the SDL-drawn cursor
  • Change the screen resolution

Tested with SDL 1.2.14 in OSX 10.5

Back in the app, the cursor isn’t drawn at the same coordinates reported by
SDL. This can be fixed by minimizing/restoring the window, or by moving the
window a little by dragging the title bar.

I’m extremely unfamiliar with the Quartz driver, so I’m a bit lost and
advancing very slowly - can any Mac guru take a look at this in the
meantime?

Thanks,
–Gabriel

Apparently there’s something wrong with the window frame after the mode
switch, since this ugly piece of code fixes it :

NSRect pRect = qz_window.frame;

pRect.origin.y++;

[qz_window setFrame:pRect display:0];

pRect.origin.y–;
[qz_window setFrame:pRect display:0];

I’m tempted to execute this whenever the desktop resolution changes (if I
find a way to get notified of that). But somehow I feel there must be a
better solution. Anyone?

Thanks,
–Gabriel