Path: utzoo!attcan!uunet!husc6!bloom-beacon!TUB.BITNET!net
From: net@TUB.BITNET (Oliver Laumann)
Newsgroups: comp.windows.x
Subject: Pointer/Button grabbing
Message-ID: <8807051536.AA00723@tub.UUCP>
Date: 5 Jul 88 15:36:56 GMT
Sender: daemon@bloom-beacon.MIT.EDU
Organization: The Internet
Lines: 30

Although I think I understood what XGrabPointer(), XGrabButton(),
XAllowEvents() etc. are doing, I'm not quite sure how and when they are
actually used.  For instance, am I right that the canonical way to do
pop-up menus (like those in uwm or xterm) is approximately like this:

    o  call XGrabButton() with an event_mask of ButtonPressed|
       ButtonReleased|PointerMotion, and a pointer_mode of GrabModeSync;

    o  when the ButtonPressed event arrives:

       o  map the menu;

       o  invoke XAllowEvents() with an event_mode of AsyncPointer;

       o  let the user select something, wait for ButtonReleased, then
          unmap the menu.

Is this a typical way XGrabButton() and XAllowEvents() are used?
Can you briefly describe a scenario where XAllowEvents() is invoked
with an event_mode other than AsyncPointer (i.e. SyncPointer or
ReplayPointer)?

Is calling XGrabButton() with a pointer_mode of GrabModeAsync
equivalent to calling it with a pointer_mode of GrabModeSync and
when the first event arrives immediately invoking XAllowEvents()
with an event_mode of AsyncPointer?

Thanks for your help.
--
Oliver Laumann              net@TUB.BITNET              net@tub.UUCP