We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 919 - Cursor is offsetted after video mode change during program execution
Summary: Cursor is offsetted after video mode change during program execution
Status: RESOLVED WORKSFORME
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: All Mac OS X (All)
: P1 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-30 09:04 UTC by Gabriel Gambetta
Modified: 2012-01-02 17:05 UTC (History)
0 users

See Also:


Attachments
Working patch (1.32 KB, patch)
2009-12-30 09:04 UTC, Gabriel Gambetta
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Gambetta 2009-12-30 09:04:44 UTC
Created attachment 474 [details]
Working patch

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.

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 attaching a patch that checks the display resolution in every PollEvents call and does the above trick if necessary.
Comment 1 Sam Lantinga 2011-12-29 01:59:32 UTC
Ryan, what do you think about this patch?  Is this even still an issue?
Comment 2 Ryan C. Gordon 2011-12-30 00:25:38 UTC
(In reply to comment #1)
> Ryan, what do you think about this patch?  Is this even still an issue?

This patch is NASTY.  :)

Let me take a look at this...a lot has changed in that code since the original bug report.

--ryan.
Comment 3 Ryan C. Gordon 2011-12-30 01:25:49 UTC
Bumping priority on a few bugs that I would like examined more closely before 1.2.15 is finalized. This is not a promise that a bug will be fixed. We may close it with WONTFIX or WORKSFORME or something, but I just want to make sure attention is paid.

--ryan.
Comment 4 Ryan C. Gordon 2012-01-02 17:05:42 UTC
I can't reproduce this. It's either something we fixed, or it was a bug in 10.5 that's since been fixed.

--ryan.