BadAccess to a GrabButton

Sam Varshavchik sam.varshavchik at gmail.com
Mon May 4 12:39:53 UTC 2020


On Mon, May 4, 2020 at 3:57 AM Walter Harms <wharms at bfs.de>
wrote:
>
> Hi  Sam Varshavchik,
> could you please elaborate a bit what you are doing exactly ?
> Someone should be able to replicate that you are doing.
>
> You have a (simple) programm you can share ?
> Even pseudo code would be ok.

I'm working on my own X11-based widget library because ...that's what
I do in my free time. For that reason, the entire code dump of
https://www.libcxx.org/w/ is not likely to work here.

I was just hoping anyone would know off the top of their head of any
other reason I might get a BadAccess response to a GrabButton, other
than the only reason described in the X11 specs. The only reason I
could find there was a conflicting grab, but according to x11trace I
was ungrabbing the button before grabbing it again.

In the meantime, for other reasons I had to reorder some of the event
handling in my library, and that made the error disappear. From what I
can tell, this sequence of events is identical:

000:<:0533: 24: Request(28): GrabButton owner-events=false(0x00)
grab-window=0x03200003
event-mask=ButtonPress,ButtonRelease,EnterWindow,LeaveWindow,PointerMotion
pointer-mode=Synchronous(0x00) keyboard-mode=Synchronous(0x00)
confine-to=None(0x00000000) cursor=None(0x00000000) button=any
button(0x00) modifiers=AnyModifier
000:<:06a7: 24: Request(28): GrabButton owner-events=false(0x00)
grab-window=0x0320004d
event-mask=ButtonPress,ButtonRelease,EnterWindow,LeaveWindow,PointerMotion
pointer-mode=Synchronous(0x00) keyboard-mode=Synchronous(0x00)
confine-to=None(0x00000000) cursor=None(0x00000000) button=any
button(0x00) modifiers=AnyModifier
000:<:06d8: 12: Request(29): UngrabButton button=any button(0x00)
grab-window=0x0320004d modifiers=AnyModifier
000:<:09f3: 24: Request(28): GrabButton owner-events=false(0x00)
grab-window=0x0320004d
event-mask=ButtonPress,ButtonRelease,EnterWindow,LeaveWindow,PointerMotion
pointer-mode=Synchronous(0x00) keyboard-mode=Synchronous(0x00)
confine-to=None(0x00000000) cursor=None(0x00000000) button=any
button(0x00) modifiers=AnyModifier
000:<:0a0a: 12: Request(29): UngrabButton button=any button(0x00)
grab-window=0x0320004d modifiers=AnyModifier
000:<:0a0d: 12: Request(29): UngrabButton button=any button(0x00)
grab-window=0x03200003 modifiers=AnyModifier

For grab-window=0x0320004d there's a grab, an ungrab, grab again, and
ungrab. Same as last time. Although the other events are different,
based on my read of the specs only other grabs should matter here, and
nothing else.


More information about the xorg mailing list