[Bug 56070] Can't click button after setting it sensitive.

gtk+ (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Fri May 26 14:28:12 UTC 2006


Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=56070
 gtk+ | gtk | Ver: 1.3.x





------- Comment #34 from Ed Catmur  2006-05-26 14:28 UTC -------
Created an attachment (id=66285)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=66285&action=view)
gtk-sensitivity.patch

Patch, against 2.9.1.

At bug 316125, Tim Janik wrote:
> this is a symptom of the more general problem that gtk doesn't synthesize
> enter/leave events upon changing the sensitivity (or global grab) state of a
> widget the way X does when windows are covered/uncovered by other windows.

This patch creates a private flag PRIVATE_GTK_SYNTH_CROSSING
(GTK_WIDGET_SYNTH_CROSSING) which tracks whether the pointer is in the control.
When the sensitivity/global grab state changes it synthesises enter/leave
events accordingly.

Detail:
* gtkprivate.h, gtktypebuiltins.c: define GTK_WIDGET_SYNTH_CROSSING
* gtkmain.c: gtk_main_do_event(): update GTK_WIDGET_SYNTH_CROSSING with
enter/leave
* gtkwidget.{c,h}:
_gtk_widget_synthesise_crossing_from_{grab_notify,state_changed}(): functions
to call from grab-notify and state-changed to synthesise enter/leave events as
appropriate. Common code in _gtk_widget_synthesise_crossing_event().
* gtkwidget.c, gtkbutton.c: call synthesis functions from grab-notify and
state-changed. (gtkbutton.c needs its own callouts because a GtkButton is a
NO_WINDOW control, but has its own GdkWindow. This means that the enter/leave
events do not get synthesised (NO_WINDOW controls don't receive events) in
gtkwidget.c. Any other control that handles its own GdkWindow outside of the
GtkWidget system will need to copy the callouts in gtkbutton.c.)

This appears to work well, and I think it's correct. Of course, I haven't
tested it all that much yet.

Changes to ABI:
* added private functions _gtk_widget_synthesise_crossing_from_*. No libversion
change needed.

Changes to API:
* private flag, functions added. No-one other than widget implementors need to
care.

Changes to behaviour:
* widgets can receive enter events immediately after turning sensitive. This is
practically indistinguishable from the user moving pointer into widget
immediately after turning sensitive. The only situation I can imagine this
causing trouble is in workarounds to this very bug.
* widgets can receive leave events immediately after turning insensitive. I
don't see this being a problem.


-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the Pkg-gnome-maintainers mailing list