Re: grabs, gdb and GTK+




Paul Barton-Davis <pbd@Op.Net> writes:

> once again, i ask the powers-that-be to consider changing the
> behaviour of certain widgets that take action on a button press
> event. their application almost always hold a server grab at that
> point, which means that if you want to use gdb to debug a function
> executed as part of the button press handler(s), you are *hosed* - you
> can't get pointer focus to leave the application until button release
> is seen by the X server and delivered.
>
> this happens, for example, in most of the widgets the generate a
> "Selection" signal - the signal is emitted by the button press
> handler, and anything attached to it is impossible to debug.
> 
> unless, of course, anyone has any hints ...

Well:

 a) This is not a server grab but a pointer grab. You probably
    can switch to another window with a window-manager shortcut
    like Alt-TAB

 b) Running your application inside of Xnest is another trick 
    to avoid grabs. (This is almost as nice as having two
    machines on your desk ... which when possible is the
    nicest solution.)

 c) When all else fails (on Linux at least) you can debug from
    a Virtual Terminal.

As for changing it - well, not having the mouse grabbed at
that point would be a bad idea - that would have strange
effects if the user clicked and dragged past the boundaries
of the window, etc. But we'll be making a change in GTK+-1.4
(Removing OwnerButtonPressGrab from the event mask) that
will allow using the automatic X button-press-grab more frequently.
The advantage of doing this is that that grab is automatically
released on button-up, even when your program is stopped.

Regards,
                                        Owen



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