After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 640282 - insensitive, active check button becomes sensitive
insensitive, active check button becomes sensitive
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.99.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-01-22 18:33 UTC by Christian Persch
Modified: 2011-01-23 18:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
C testcase (1.31 KB, text/plain)
2011-01-22 18:33 UTC, Christian Persch
Details

Description Christian Persch 2011-01-22 18:33:46 UTC
Created attachment 179050 [details]
C testcase

Steps to repro: Compile the attached testcase, and run it.

Expected results: The testcases contains some checkbuttons, that are set to active=true, sensitive=false. Therefore, the checkbuttons should be pre-checked but insensitive.

Actual results:
The 2nd checkbutton is sensitive. After the timeout toggles the 3rd checkbutton for the first time, it too becomes sensitive!

The difference between the buttons is the order in which the properties are set. It appears that setting the checkbutton insensitive first, then active, will override the sensitive property!
Comment 1 Christian Persch 2011-01-22 22:24:32 UTC
It's happening like this:

Breakpoint 1, gtk_widget_set_sensitive (widget=0x80a33e8, sensitive=1) at gtkwidget.c:7575
(gdb) where
  • #0 gtk_widget_set_sensitive
    at gtkwidget.c line 7575
  • #1 _gtk_widget_update_state_flags
    at gtkwidget.c line 6969
  • #2 gtk_widget_set_state_flags
    at gtkwidget.c line 7033
  • #3 gtk_toggle_button_update_state
    at gtktogglebutton.c line 583
  • #4 gtk_toggle_button_clicked
    at gtktogglebutton.c line 546
  • #5 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 79
  • #6 g_type_class_meta_marshal
    at gclosure.c line 878
  • #7 g_closure_invoke
    at gclosure.c line 767
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3182
  • #9 g_signal_emit_valist
    at gsignal.c line 2983
  • #10 g_signal_emit
    at gsignal.c line 3040
  • #11 gtk_button_clicked
    at gtkbutton.c line 1194
  • #12 gtk_toggle_button_set_active
    at gtktogglebutton.c line 385

Comment 2 Carlos Garnacho 2011-01-23 18:47:22 UTC
Ouch, my bad, I've fixed this and other situations I've seen where something similar could happen, the relevant commits to this bug are a0e1fa9e and 0c7772f0cf