| Summary: | Should SDL_WM_GrabInput()/X11_GrabInputNoLock() block? | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Petr Pisar <ppisar> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | renesd, sezeroz |
| Version: | HG 1.2 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
Proposed patch for SDL-1.2 unblocking GrabNotViewable case
Test case |
||
|
Description
Petr Pisar
2011-03-01 06:50:35 UTC
I was actually thinking about this, this morning! SDL 1.3 is not going to block, and I'll probably be implementing that code today. See ya! Created attachment 648 [details]
Proposed patch for SDL-1.2 unblocking GrabNotViewable case
This patch changes behavior of SDL-1.2. If SDL window is not viewable, SDL_WM_GrabInput() will not block and will return failure.
My question is whether this patch is acceptable for inclusion into SDL-1.2 or whether it changes API that applications could expect inappropriately.
Created attachment 649 [details]
Test case
It links to SDL and X11. It moves SDL window out of root window to create not viewable window where XGrabPointer fails.
I don't want to change application behavior in 1.2, but you're welcome to submit a patch for SDL 1.3. Thanks! Note, at least Arch linux includes this: https://git.archlinux.org/svntogit/packages.git/tree/trunk/SDL-1.2.10-GrabNotViewable.patch?h=packages/sdl Sam: At least two distros (RedHat/Fedora and Arch) has been applying this patch for quite some time, e.g. for about 7 years. Can we at least provide it under a 'contrib' directory along with its testcase? Patch added, thanks! https://hg.libsdl.org/SDL/rev/0f469a8b5110 |