[comp.windows.x] Ungrabbing the pointer

RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) (01/06/88)

    Date: 4 Jan 88 11:17:42 PST (Monday)
    Subject: Ungrabbing the pointer

    Why does XUngrabPointer ungrab all previous pointer grabs?

Because you are grabbing the device, and there is only one of them.

							        Is possible to have
    one client grab the pointer in two separate sibling windows?

No.
								 An example would be
    a client that controls two separate windows, each having many subwindows. The
    client would like to control a separate rubberbanding box in both windows with
    the ability to leave one window, thereby suspending that rubberband until
    reentry. Then move to the other window and pick up a rubberbanding box in that
    one.

Then don't grab the pointer at all; the window-based demultiplexing should be
sufficient, or else you haven't adequately explained how you want the user interface
to function.

	 The GrabPointer call seems to allow me to specify a particular window to
    grab a particular event in,

No, it allows you to specify the window with respect to which to report events.
The grab is on the pointer, not the window or the pair.

				but the Ungrab seems to assume you want to undo
    everything.

Correct.

		The UnGrabButton on the other hand lets you undo a GrabButton in a
    particular window.

Right, because this is establishing a passive grab on the button/window
combination.  (But when the grab activates, it is still grabbing the
"entire" pointer.)