You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In short: Public SDL_WM_GrabInput() calls X11_GrabInputNoLock() that loops around XGrabPointer() until it succeeds.
According X11 manual, XGrabPointer() will fail, if window is not visible (return value GrabNotViewable), if other window holds grab already (AlreadyGrabbed), if other window holds grab and has frozen the input (GrabFrozen) and if invalid arguments (window ID etc.) are supplied.
SDL-1.2 branch does not handle these errors. It just waits until it grabs pointer. On the other hand it does not loop on grabbing keyboard focus.
There is also a comment in SDL code that raises this question: What to do in case of error.
Application developers want to return SDL_GRAB_OFF immediately. I worry it will break SDL 1.2 API. OTOH, SDL-1.3 tries to grab only if the window has focus. However it still loops (e.g. on AlreadyGrabbed).
What's your opinion?
On 2011-03-01 08:25:39 +0000, Sam Lantinga wrote:
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!
On 2011-07-20 07:10:50 +0000, Petr Pisar wrote:
Created attachment 648
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.
On 2011-07-20 07:12:24 +0000, Petr Pisar wrote:
Created attachment 649
Test case
It links to SDL and X11. It moves SDL window out of root window to create not viewable window where XGrabPointer fails.
On 2011-12-29 01:37:04 +0000, Sam Lantinga wrote:
I don't want to change application behavior in 1.2, but you're welcome to submit a patch for SDL 1.3.
Thanks!
On 2018-08-13 06:57:40 +0000, Rene Dudfield wrote:
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?
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86_64
Comments on the original bug report:
On 2011-03-01 06:50:35 +0000, Petr Pisar wrote:
On 2011-03-01 08:25:39 +0000, Sam Lantinga wrote:
On 2011-07-20 07:10:50 +0000, Petr Pisar wrote:
On 2011-07-20 07:12:24 +0000, Petr Pisar wrote:
On 2011-12-29 01:37:04 +0000, Sam Lantinga wrote:
On 2018-08-13 06:57:40 +0000, Rene Dudfield wrote:
On 2018-08-16 20:37:03 +0000, Ozkan Sezer wrote:
On 2018-08-28 20:07:54 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: