Re: Problem with gdk_pointer_is_grabbed() + test program




Damon Chaplin <damon@karuna.freeserve.co.uk> writes:

> It's mentioned in a few places in the XLib Programming Manual (e.g. pg 314)
> The manual says that a pointer grab between button_press & button_release
> is such a common desire by applications that it is done automatically.
> (Though if that is the case, I'm not sure why widgets like clist try to
> grab the pointer themselves. I suppose it makes it more explicit.)

Basically to change the options for the grab from the defaults -
the cursor, the event mask, and most particularly, the owner_events
parameter.

As a very long-standing misfeature, GDK always adds in
OwnerGrabButtonMask when the user asks for GDK_BUTTON_PRESS
or GDK_BUTTON_RELEASE; so the grab is done with
owner_events = TRUE. That means that mouse events that
would normally go to other windows of the current application
are propagated normally. This is normally not what you
want.

I wonder if Peter perhaps didn't understand owner_events
when he did that... I can't think of where this is useful.

(Good project for somebody - remove that flag from
 gdk_event_mask_table[] in gdkevents.c and see if anything breaks)

> >From what Owen wrote I assume the grab is released even if your application
> has been 'frozen' by gdb, so it shouldn't be a problem.
> 
> But I've tried using "gdk_pointer_ungrab(); gdk_flush();" before the abort()
> and it only works sometimes.

No idea why this wouldn't work.
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]