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 101 - X11 mouse and focus loss
Summary: X11 mouse and focus loss
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: All Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-27 12:55 UTC by Ryan C. Gordon
Modified: 2006-04-27 06:44 UTC (History)
0 users

See Also:


Attachments
Reproduction case. (1.89 KB, text/x-csrc)
2006-01-27 12:56 UTC, Ryan C. Gordon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan C. Gordon 2006-01-27 12:55:06 UTC
Scenario:

A message window pops up and the SDL fullscreen window loses focus. Under the hood, SDL responds to this by reverting to a window, but doesn't seem to unlock the mouse cursor; the cursor sits visible in the center of the newly-windowed SDL surface. This is happening reliably here with both metacity and icewm window managers in a Gnome environment on XFree86 4.3.0 (gentoo's 4.3.0-r3, specifically)...also happens with Metacity on x.org 6.8.2 (Ubuntu 5.10 default).

At the application level, if I call SDL_ShowCursor(1) in my SDL_ACTIVEEVENT handler, the mouse moves correctly across the desktop. So the SDL_ACTIVEEVENT code ends up looking like:

    case SDL_ACTIVEEVENT:
        SDL_ShowCursor(event.active.gain ? 0 : 1);
        break;

I've attached a program to demonstrate this. Run it, ssh in to your box and launch an xterm so the SDL window loses focus. See how mouse cursor becomes visible but doesn't move. Exit the new xterm so it goes away and (hopefully) returns focus to your SDL window, and hit ESC to terminate the program.

Rerun program with --showhide to manually show/hide the cursor in the SDL_ACTIVEEVENT handler, which "fixes" the issue.

You may also notice that the windowed SDL surface resists being dragged around by its title bar, but that might just be metacity.

--ryan.
Comment 1 Ryan C. Gordon 2006-01-27 12:55:27 UTC
Tossing to Sam.

--ryan.

Comment 2 Ryan C. Gordon 2006-01-27 12:56:05 UTC
Created attachment 45 [details]
Reproduction case.


Attached test program.

--ryan.
Comment 3 Sam Lantinga 2006-04-27 06:44:59 UTC
This is fixed in SVN, thanks!