Pointer grabs causing accessibility issues! Why not deprecate them?
francesco.fumanti at gmx.net
Tue Apr 29 04:10:09 PDT 2008
Thanks for the list of examples.
I deduce from it, that it would probably also not make sense to add
recommendations about avoiding pointer grabs to the developers' guides;
as drag and drop, popups,... are standard elements of a modern
application with gui.
Or are these pointer grabs only internal mechanism that the application
developer does not have to explicitely call?
Peter Hutterer wrote:
> Francesco Fumanti wrote:
>> Could you please expand on the main reasons why it is not feasible?
>> For example, in what situations are the pointer grabs really
>> unavoidable and unreplacable by other techniques?
> pointer grabs are a method of guaranteeing that events are delivered to
> a certain client - and not to the window underneath the pointer as usual.
> the most common uses I can think of:
> - popup menus: apps use grabs for them because it can tell them whether
> the following click was on the window or outside. implementing the same
> functionality without a grab would require the client to register for
> click events on every single visible window. This is unfeasable.
> - drag and drop: grabs are the only way how to guarantee you'll get all
> motion events. the only other way is to register for motion events on
> every single visible window.
> - event interception: passive grabs (synchronised ones anyway) allow you
> to receive an event before the actual window under the cursor gets it.
> window managers use this extensively to e.g. raise and focus window when
> you click into it. the WM then tells the X server to replay the event on
> the client window. this can't be done any other way.
> - keyboard shortcuts: passive keyboard grabs are what makes your
> shortcuts work. without them - no shortcuts. unless your client
> registers for key events on every... you know the drill :)
> and of course the example you mentioned where a grab ensures nobody can
> sniff on the input data (too easily anyway).
> I don't know of any other techniques but if you come up with some I'd be
> interested to read about them. The only thing that may work is to
> restrict the exclusiveness of a grab (a event delivered to a grabbing
> client be also delivered to the actual client). but believe me, here be
> PS: I believe windows has a similar feature called "captures", although
> I do not know how they work exactly. Not sure what OS X has, haven't
> done any mentionable GUI programming there.
More information about the xorg