Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor doesn't update properly on alt-tab #825

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Cursor doesn't update properly on alt-tab #825

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 10, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Mac OS X 10.7, x86_64

Comments on the original bug report:

On 2013-04-10 14:35:07 +0000, Alex Szpakowski wrote:

Created attachment 1106
Small program for testing the cursor bug

If I have a custom cursor set, and my cursor is inside an SDL2 window and I alt/cmd-tab to a different program, the cursor will revert to the default system cursor as expected.
However, if I alt/cmd-tab back into the SDL program with the cursor position inside the window bounds, SDL_WINDOWEVENT_ENTER will trigger correctly, but the cursor will not be set to the expected custom one until I move it completely out of the SDL window and back in (triggering a second SDL_WINDOWEVENT_ENTER).

I've been able to work around this bug by explicitly forcing a cursor update (calling SDL_SetCursor(NULL)) when SDL_WINDOWEVENT_ENTER is triggered, but that's just a workaround.

I have only tested this on Mac OS 10.8.3 so I don't know if it's an OS-specific issue.

On 2013-04-22 22:26:07 +0000, (disabled) Jørgen Tjernø wrote:

I'm able to reproduce this on Mac with the code you provided (not tested on other platforms)

This is probably caused by calling -[NSCursor set] on OSX when we get the windowDidBecomeKey: notification, which doesn't work.

Fixes include:

  • Switch to using cursor rects (patch for 1.2's Quartz video backend is here http://hg.libsdl.org/SDL/rev/b8f2db95145e)
  • Schedule the 'set' call to be called in the event loop in a short a timespan as possible.

I also notice that we do +[NSCursor hide] and +[NSCursor unhide] without regard for balancing them. According to the docs, each hide has to be matched with one unhide. We should probably fix that too.

On 2013-04-23 21:53:22 +0000, (disabled) Jørgen Tjernø wrote:

Should be fixed in http://hg.libsdl.org/SDL/rev/ffd910de700b - please reopen if it hasn't been.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant