automatic/passive grab vs XGrabPointer/XUngrabPointer q
Erez D
erez0001 at gmail.com
Sun Jul 11 11:47:52 IDT 2010
ok, thanks
I've written a small utility that checks it.
results:
1. XUngrabPointer does ungrab the XSerever's auto grab
2. XGrabPointer does ovveride the Xserver's auto grab (even without
XUngrabPointer first)
On Thu, Jul 8, 2010 at 6:28 PM, guy keren <choo at actcom.co.il> wrote:
> Erez D wrote:
>
>> hi
>>
>> X automatically does pointer grab when the mouse drags (i.e. press and
>> hold the mouse button while moving it).
>> It is possible to override the auto grab settings (i.e owner_events, etc)
>> with a passive grab (e.g. XGrabButton)
>>
>> what if:
>>
>> 1. the user presses mouse button 1 (and holds it down)
>> 2. the use moves the mouse
>> 3. the application calles XUngrabPointer -> will it ungrab ?
>> or..
>> 3. the application calles XGrabPointer (withough XUngrabPointer first) ->
>> will it regrab ?
>>
>> thanks,
>> erez.
>>
>
> 3.a no idea - this is not specifically explained in the man page - you'll
> need to check with a test program.
>
> 3.b read the man page for XGrabPointer:
> " If the pointer is actively grabbed by some other client, it fails and
> returns Already‐Grabbed. If the pointer is frozen by an active grab of
> another client, it fails and returns GrabFrozen."
>
but auto grab is a passive grab.
>
> note: the grab is done by some client. the question is - when you say "X
> automatically does pointer grab" - who are you talking about? the X server
> does NOT do that. it is more likely that the toolkit in use (or the window
> manager, if this is a drag on one of the windows it created, which include
> the title-bar/borders of all application windows) does this.
>
The X server DO does it. it works without any utility, without a window
manager or any pager of sort sort.
I do not use any toolkit. just the xlib.
>
> so the question is - do you want to affect a drag&drop done by the same
> application in which your code resides? if so - it seems to be possible to
> do this - provider that you can send the right time-stamp (with regards to
> re-grabs). however, by doing this, you _might_ disrapt the working of the
> toolkit - so you should check that this does not happen by testing and by
> reading the source - and probably also by asking on the mailing list of the
> relevant toolkit.
>
again, it has nothing to do with a toolkit. I only use xlib. no toolkit, no
window manager etc ...
>
> --guy
>
thanks.
erez.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20100711/0a3f88a6/attachment.html>
More information about the Linux-il
mailing list