Re: Problem with gdk_pointer_is_grabbed() + test program




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

> Damon Chaplin wrote:
> > 
> > gdk_pointer_is_grabbed() often returns 0 even if there is a grab.
> 
> 
> I've just remembered that X does an automatic pointer grab if a
> window selects both button_press & button_release events.
> 
> So gdk_pointer_is_grabbed() shouldn't be considered totally reliable.

This isn't in itself a problem for your application, since
such grabs will be released when the mouse pointer is
released, automatically.

There are other reasons why gdk_pointer_is_grabbed() is not
reliable (it was implemented perhaps without a full understanding
of how grabs work in X) - it doesn't account for the fact that the 
grab is released from  not-viewable windows, it won't catch a grab 
that was made directly from XLib (including passive grabs).

I'd guess your problem occurs because of a lack of a flush -
The CList has released the grab but X hasn't been informed
of the fact yet. Try putting a gdk_flush() before you
abort. 

(xnest and keyboard shortcuts to switch active windows are
other ways to deal with debugging through grabs)

Regards,
                                        Owen




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