Re: GtkButton 'enter' and 'leave' signal emission oddity



"T.C. Gubatayao" <TCG BardenEnt com> writes:

I'm working with gtk+-2.0.8 on FreeBSD 4.7-STABLE (noticed this in
gtk+-2.0.7 as well, though).
 
The signals 'enter' and 'leave' work as expected for mouse movement over
the button, but the unexpected behavior is when a GtkButton is pressed.
If you create a program and use g_signal_connect () to attach to of the
signals, for each click of the button, the signals are emitted in the
following order:
 
leave
enter
pressed
clicked
released
 
Why are the signals 'leave' and 'enter' emitted when the mouse has not
left the button?

Actually the relevant thing here that you haven't mentioned here
is that you are using Metacity. The way Metacity does click-to-focus
causes these spurious leave/enter events. 

The problem could be reduced a lot by making Metacity remove it's 
XGrabButton() on the currently focused toplevel.

(In general, you don't want to connect to ::enter ::leave - they
are details of how the button work that wouldn't be exposed if
we were doing GtkButton again from scratch.)

Regards,
                                        Owen



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