[Xevie] Question about synchronous grabs

Deron Johnson Deron.Johnson at Sun.COM
Thu Nov 11 11:58:51 PST 2004


Does anybody know what is the purpose of a synchronous grab in X?
Basically, a synchronous grab records incoming events while it is
active instead of sending them down the event pipeline. Only when
a client actively releases the synchronous grab does the event
pipeline start flowing again. And the recorded events are first played
back. So I know how synchronous grabs behave, but I'm not entirely
sure that I know what purpose they serve.

One purpose I can think of is to implement type-ahead (or mouse-ahead).
The user clicks a button which brings up a dialog. The button click
triggers a passive grab which is synchronous. The app then maps a
dialog window. After the window is up the app releases the synchronous
grab and any key events which the user has typed while the dialog
window was coming up will be sent to the dialog window.

Are there any other uses of synchronous grabs? How prevalent are
apps that use synchronous grabs? Does anyone know whether GNOME or
KDE use them?

The reason I ask is because synchronous grabs account of a significant
amount of complexity in the X server event code. I am questioning
whether it is worth trying to support these in my Display Server event
subsystem. The code is so complicated and involved that there are bound
to be transcription errors during any port.





More information about the xevie mailing list