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 736307 - GtkStackSwitcher doesn't like removing children from stack
GtkStackSwitcher doesn't like removing children from stack
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-09-09 04:40 UTC by Hubert Figuiere (:hub)
Modified: 2014-09-12 01:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample code (1.98 KB, text/plain)
2014-09-09 04:40 UTC, Hubert Figuiere (:hub)
Details
sample code 2 (2.06 KB, text/plain)
2014-09-11 07:21 UTC, Kjell Ahlstedt
Details

Description Hubert Figuiere (:hub) 2014-09-09 04:40:34 UTC
Created attachment 285708 [details]
sample code

GtkStackSwitcher doesn't like removing children from stack

Compile the attached sample.

Run it.

Close the window.

I get warnings:

(sample:21591): Gtk-WARNING **: gtkstack.c:556: invalid child property id 2 for "title" of type 'GParamString' in 'GtkStack'

(sample:21591): Gtk-WARNING **: gtkstack.c:556: invalid child property id 3 for "icon-name" of type 'GParamString' in 'GtkStack'

(sample:21591): Gtk-CRITICAL **: gtk_widget_set_valign: assertion 'GTK_IS_WIDGET (widget)' failed

(sample:21591): Gtk-CRITICAL **: gtk_bin_get_child: assertion 'GTK_IS_BIN (bin)' failed

(sample:21591): Gtk-CRITICAL **: gtk_widget_get_style_context: assertion 'GTK_IS_WIDGET (widget)' failed

(sample:21591): Gtk-CRITICAL **: gtk_widget_set_visible: assertion 'GTK_IS_WIDGET (widget)' failed

(sample:21591): Gtk-CRITICAL **: gtk_widget_set_size_request: assertion 'GTK_IS_WIDGET (widget)' failed

(sample:21591): Gtk-WARNING **: gtkstack.c:556: invalid child property id 5 for "needs-attention" of type 'GParamBoolean' in 'GtkStack'

(sample:21591): Gtk-CRITICAL **: gtk_widget_get_style_context: assertion 'GTK_IS_WIDGET (widget)' failed

(sample:21591): Gtk-CRITICAL **: gtk_style_context_remove_class: assertion 'GTK_IS_STYLE_CONTEXT (context)' failed

(sample:21591): Gtk-WARNING **: gtkstack.c:556: invalid child property id 2 for "title" of type 'GParamString' in 'GtkStack'

(sample:21591): Gtk-WARNING **: gtkstack.c:556: invalid child property id 3 for "icon-name" of type 'GParamString' in 'GtkStack'

(sample:21591): Gtk-CRITICAL **: gtk_widget_set_valign: assertion 'GTK_IS_WIDGET (widget)' failed

(sample:21591): Gtk-CRITICAL **: gtk_bin_get_child: assertion 'GTK_IS_BIN (bin)' failed

(sample:21591): Gtk-CRITICAL **: gtk_widget_get_style_context: assertion 'GTK_IS_WIDGET (widget)' failed

(sample:21591): Gtk-CRITICAL **: gtk_widget_set_visible: assertion 'GTK_IS_WIDGET (widget)' failed

(sample:21591): Gtk-CRITICAL **: gtk_widget_set_size_request: assertion 'GTK_IS_WIDGET (widget)' failed

(sample:21591): Gtk-WARNING **: gtkstack.c:556: invalid child property id 5 for "needs-attention" of type 'GParamBoolean' in 'GtkStack'

(sample:21591): Gtk-CRITICAL **: gtk_widget_get_style_context: assertion 'GTK_IS_WIDGET (widget)' failed

(sample:21591): Gtk-CRITICAL **: gtk_style_context_remove_class: assertion 'GTK_IS_STYLE_CONTEXT (context)' failed



If I do that from a larger Gtkmm program (in Gtkmm), I actually get crashes.... almost automatically.

Expect:

Removing the children of a stack should be fine and the switcher should deal with it properly.

Note: I only have Gtk+ 3.12.2
Comment 1 Bastien Nocera 2014-09-09 18:07:59 UTC
I can reproduce that with master.
Comment 2 Hubert Figuiere (:hub) 2014-09-09 19:26:20 UTC
That would be commit 2e88ae8ad99a07e5adf1264dead14f71d978b461

Thanks !!!!
Comment 3 Kjell Ahlstedt 2014-09-11 07:21:30 UTC
Created attachment 285883 [details]
sample code 2

Here's a slightly modified test case, showing there are still problems with
GtkStackSwitcher.

I think the problem is that clear_switcher() does not undo everything that
populate_switcher() has done. When gtk_stack_switcher_set_stack() is called
a second time (in the test case it's called from gtk_stack_switcher_dispose()),
signal handlers are not disconnected from the children of the previously
connected GtkStack.

This problem was first noticed in the C++ test case in the gtkmm bug 736339.
Comment 4 Matthias Clasen 2014-09-11 17:37:02 UTC
I would have preferred a new bug for that - seems a separate issue. Thanks for the testcase, anyway.
Comment 5 Hubert Figuiere (:hub) 2014-09-12 01:12:25 UTC
This is 3d7f0590870d76b61d1645fef6eb099445b11073

Thanks again.