GtkComboBox::private::popup_window can be NULL
When I open File->New->Contact in Evolution, it shows 4 runtime warnings:
Gtk-CRITICAL **: gtk_widget_is_drawable: assertion 'GTK_IS_WIDGET (widget)' failed
when I catch backtrace of the first of them, then it gets:
#0 0x00007ffff733d7e0 in g_logv (log_domain=0x7ffff6b2a5b8 "Gtk", log_level=G_LOG_LEVEL_CRITICAL, format=0x7ffff73887ea "%s: assertion '%s' failed", args=args@entry=0x7fffffffcd20) at gmessages.c:1248
#1 0x00007ffff733dbaf in g_log (log_domain=log_domain@entry=0x7ffff6b2a5b8 "Gtk", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff73887ea "%s: assertion '%s' failed") at gmessages.c:1403
#2 0x00007ffff733e0f9 in g_return_if_fail_warning (log_domain=log_domain@entry=0x7ffff6b2a5b8 "Gtk", pretty_function=pretty_function@entry=0x7ffff6bb1290 <__func__.65487> "gtk_widget_is_drawable", expression=expression@entry=0x7ffff6b2a618 "GTK_IS_WIDGET (widget)") at gmessages.c:2702
#3 0x00007ffff6ade35a in gtk_widget_is_drawable (widget=0x0) at gtkwidget.c:9173
#4 0x00007ffff68bb58a in gtk_combo_box_popdown (combo_box=combo_box@entry=0x6a60890 [GtkComboBox]) at gtkcombobox.c:2429
#5 0x00007ffff68bb889 in gtk_combo_box_unmap (widget=0x6a60890 [GtkComboBox]) at gtkcombobox.c:4138
#6 0x00007ffff5ea8976 in _g_closure_invoke_va (closure=0x65e5f0, return_value=0x0, instance=0x6a60890, args=0x7fffffffd070, n_params=0, param_types=0x0) at gclosure.c:867
#7 0x00007ffff5ec3ff4 in g_signal_emit_valist (instance=0x6a60890, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffd070) at gsignal.c:3300
#8 0x00007ffff5ec466f in g_signal_emit (instance=instance@entry=0x6a60890, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3447
#9 0x00007ffff6adb85c in gtk_widget_unmap (widget=0x6a60890 [GtkComboBox]) at gtkwidget.c:5027
#10 0x00007ffff6ae1698 in gtk_widget_unrealize (widget=0x6a60890 [GtkComboBox]) at gtkwidget.c:5515
#11 0x00007ffff6aecdbd in gtk_widget_unparent (widget=0x6a60890 [GtkComboBox]) at gtkwidget.c:4616
#12 0x00007ffff694bccc in gtk_grid_remove (container=0x68fb180 [EContactEditorDynTable], child=<optimized out>) at gtkgrid.c:511
#13 0x00007ffff5eab929 in g_cclosure_marshal_VOID__OBJECTv (closure=0x683c00, return_value=<optimized out>, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x683c30)
at gmarshal.c:2102
#14 0x00007ffff5ea8976 in _g_closure_invoke_va (closure=0x683c00, return_value=0x0, instance=0x68fb180, args=0x7fffffffd510, n_params=1, param_types=0x683c30) at gclosure.c:867
#15 0x00007ffff5ec3ff4 in g_signal_emit_valist (instance=0x68fb180, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffd510) at gsignal.c:3300
#16 0x00007ffff5ec466f in g_signal_emit (instance=instance@entry=0x68fb180, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3447
#17 0x00007ffff68c5306 in gtk_container_remove (container=0x68fb180 [EContactEditorDynTable], widget=0x6a60890 [GtkComboBox]) at gtkcontainer.c:1905
#18 0x00007ffff6ae3d74 in gtk_widget_dispose (object=0x6a60890 [GtkComboBox]) at gtkwidget.c:12068
#19 0x00007ffff5eaee5c in g_object_run_dispose (object=0x6a60890 [GtkComboBox]) at gobject.c:1100
#20 0x00007fffc257b354 in remove_empty_entries (dyntable=0x68fb180 [EContactEditorDynTable], fillup=1) at ....evolution/src/addressbook/gui/contact-editor/e-contact-editor-dyntable.c:322
#21 0x00007fffc257b866 in e_contact_editor_dyntable_set_max_entries (dyntable=0x68fb180 [EContactEditorDynTable], max=50) at ....evolution/src/addressbook/gui/contact-editor/e-contact-editor-dyntable.c:442
#22 0x00007fffc256d23f in sensitize_email (editor=0x55c6510 [EContactEditor]) at ....evolution/src/addressbook/gui/contact-editor/e-contact-editor.c:1110
#23 0x00007fffc2575b5f in sensitize_all (editor=0x55c6510 [EContactEditor]) at ....evolution/src/addressbook/gui/contact-editor/e-contact-editor.c:3843
#24 0x00007fffc257a437 in e_contact_editor_set_property (object=0x55c6510 [EContactEditor], property_id=7, value=0x7fffffffd830, pspec=0x6a2b2c0 [GParamPointer])
at ....evolution/src/addressbook/gui/contact-editor/e-contact-editor.c:5503
#25 0x00007ffff5eb069e in object_set_property (nqueue=0x7fff68db3630, value=0x7fffffffd810, pspec=0x6a2b2c0 [GParamPointer], object=0x55c6510 [EContactEditor]) at gobject.c:1439
#26 0x00007ffff5eb069e in g_object_set_valist (object=object@entry=0x55c6510 [EContactEditor], first_property_name=first_property_name@entry=0x7fffc257f391 "writable_fields", var_args=var_args@entry=0x7fffffffd8e0) at gobject.c:2300
#27 0x00007ffff5eb107c in g_object_set (_object=0x55c6510, first_property_name=0x7fffc257f391 "writable_fields") at gobject.c:2465
#28 0x00007fffc2579923 in supported_fields_cb (source_object=0x7fff5c00bd90 [EBookClient], result=0x6262520, user_data=0x55c6510) at ....evolution/src/addressbook/gui/contact-editor/e-contact-editor.c:5255
#29 0x00007ffff6165966 in g_simple_async_result_complete (simple=0x6262520 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
#30 0x00007ffff6165a09 in complete_in_idle_cb_for_thread (_data=_data@entry=0x68e0460) at gsimpleasyncresult.c:872
#31 0x00007ffff7333577 in g_idle_dispatch (source=0x7ffec4002c40, callback=0x7ffff61659f0 <complete_in_idle_cb_for_thread>, user_data=0x68e0460) at gmain.c:5486
#32 0x00007ffff7336b77 in g_main_dispatch (context=0x660fc0) at gmain.c:3142
#33 0x00007ffff7336b77 in g_main_context_dispatch (context=context@entry=0x660fc0) at gmain.c:3795
#34 0x00007ffff7336f20 in g_main_context_iterate (context=0x660fc0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3868
#35 0x00007ffff7337232 in g_main_loop_run (loop=0x543cce0) at gmain.c:4064
#36 0x00007ffff698dca5 in gtk_main () at gtkmain.c:1322
#37 0x0000000000404e0e in main (argc=1, argv=0x7fffffffdcf8) at ....evolution/src/shell/main.c:675
and in frame 4:
(gdb) f 4
#4 0x00007ffff68bb58a in gtk_combo_box_popdown (combo_box=combo_box@entry=0x6a60890 [GtkComboBox]) at gtkcombobox.c:2429
2429 if (!gtk_widget_is_drawable (priv->popup_window))
(gdb) l
2424 }
2425
2426 if (!gtk_widget_get_realized (GTK_WIDGET (combo_box)))
2427 return;
2428
2429 if (!gtk_widget_is_drawable (priv->popup_window))
2430 return;
2431
2432 if (priv->grab_pointer)
2433 gdk_seat_ungrab (gdk_device_get_seat (priv->grab_pointer));
(gdb) p *priv
$1 = {model = 0x0, area = 0x0, col_column = -1, row_column = -1, wrap_width = 0, active = -1, active_row = 0x0, tree_view = 0x0, cell_view = 0x5d2d7a0 [GtkCellView], box = 0x67e2da0 [GtkBox], button = 0x66d2d70 [GtkToggleButton],
arrow = 0x7fff6c023580 [GtkIcon], popup_widget = 0x0, popup_window = 0x0, scrolled_window = 0x0, gadget = 0x66d1210 [GtkCssCustomGadget], popup_idle_id = 0, trigger_event = 0x0, scroll_timer = 0, resize_idle_id = 0,
text_column = -1, text_renderer = 0x0, id_column = -1, popup_in_progress = 0, popup_shown = 0, add_tearoffs = 0, has_frame = 1, is_cell_renderer = 0, editing_canceled = 0, auto_scroll = 0, button_sensitivity = 0, has_entry = 0,
popup_fixed_width = 1, row_separator_func = 0x0, row_separator_data = 0x0, row_separator_destroy = 0x0, grab_pointer = 0x0, tearoff_title = 0x0}
Briefly looking into the code, it looks like the priv->popup_window can be NULL in case the combo box shows a GtkMenu, but I can be wrong here.
Do you think I should try some ugly magic in Evolution to avoid this state, or a one-liner either in gtk_widget_is_drawable() to remove the runtime warning or in gtk_combo_box_popdown() to change line 2429 into:
if (!priv->popup_window || !gtk_widget_is_drawable (priv->popup_window))
would be possible, please?