GNOME Bugzilla – Bug 609612
Glade UI lockup in menu editor.
Last modified: 2010-12-19 07:50:06 UTC
Created attachment 153504 [details] Screenshot of the breakage. When using the menu editor in glade 3.6.7, the entire UI locks up when you perform the following actions: * Enter a value in the name field which contains a space. * Click on the "Type" combo box to expand it. at which point the message (glade-3:24434): Gtk-CRITICAL **: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed is printed to the terminal many times, and the menu editor window looks like the attached screenshot. All windows in the program cease responding to input, but will still redraw themselves on expose.
Whoops, I just discovered that it occurs when making /any/ change to the name field at all; there is no need to insert a space.
Investigating this bug I discovered a way to not trigger it: * Enter a value in the name field which contains a space. * Click on anywhere else but the "Type" combo box. * Click on the "Type" combo box to expand it. Will not trigger the bug.
Created attachment 156597 [details] [review] Fixes gladeui lokup in menu editor Correctly treats name changes in glade_base_editor_add_default_properties in glade-base-editor.c. The attached fixes the bug. Please commit it.
Although the latest patch works as intended, the signal emmited (by the cascade of events that follows calling glade_command_set_name) by glade_project_set_widget_name makes the entry loses focus. Still investigating why this happens.
The signal "widget-name-changed" which is connected in glade_base_editor_set_container changes the text in the entry we are editing. I think this is what is causing the lose of the focus. If I comment this connection, we dont lose the focus anymore, but changing the name of a widget with glade editor table no longer updates the name of the widget in glade base editor. Waiting for an idea on how to fix it...
Created attachment 156603 [details] [review] Fixes gladeui lokup in menu editor The attached fixes the bug. Please commit it.
Review of attachment 156603 [details] [review]: Hi, Thanks for finding the culprit. One problem I can see before testing the patch, you are using a static variable to avoid the feedback loop for "widget-name-changed", this is error prone because the GladeBaseEditor is not a singleton and can have multiple instances in memory. Also, you may find scattered code in Glade that still does this with a boolean variable but in general where possible we like to address this type of feedback problem with g_signal_handlers_block/unblock_by_func() instead (this function can be easily used to avoid firing the widget_name_changed() code when programatically updating the entry text). We also wont be needing the '//fixing' comment sitting beside the new "changed" signal handler connection.
*** Bug 589217 has been marked as a duplicate of this bug. ***
Created attachment 156820 [details] [review] Fixes gladeui lockup in menu editor Changes applied. Please commit it.
Review of attachment 156820 [details] [review]: Thanks thats much nicer :)
Review of attachment 156820 [details] [review]: Oops sorry. After a closer look I see that your patch obsoletes glade_base_editor_name_focus_out(). Using changed is better, agreed, but the connection to _focus_out() and the focus_out() handler should be removed with this patch too.
Created attachment 156825 [details] [review] Fixes gladeui lockup in menu editor Removed uneeded code. Please commit it.
Thanks for fixing this. Closing.
*** Bug 602436 has been marked as a duplicate of this bug. ***
https://bugzilla.gnome.org/show_bug.cgi?id=603607 Seems like a duplicate too.
*** Bug 603607 has been marked as a duplicate of this bug. ***