GNOME Bugzilla – Bug 513230
Crash when using _set_tab_reorderable but tabs are hidden
Last modified: 2008-02-28 06:33:02 UTC
Steps to reproduce: 1. Create a new notebook, and set show-tabs to FALSE 2. Create a new widget, and append it to the notebook 3. Set the tab reorderable for the new widget 4. Click anywhere on the GUI that opens a popup (combobox, volumebutton, ...) 5. The application crashes Stack trace: /* gcc $(pkg-config --libs-only-l --cflags-only-I gtk+-2.0) notebook.c -o notebook */ #include <gtk/gtk.h> int main (int argc, char *argv[]) { gtk_init (&argc, &argv); GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); GtkWidget *vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), vbox); /* It has to be a widget with a popup, GtkComboBox, GtkVolumeButton, ... */ GtkWidget *combobox = gtk_combo_box_new_text (); gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), "combobox"); gtk_container_add (GTK_CONTAINER (vbox), combobox); GtkWidget *notebook = gtk_notebook_new (); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); gtk_container_add (GTK_CONTAINER (vbox), notebook); GtkWidget *label = gtk_label_new ("Hello world!"); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), label, NULL); gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (notebook), label, TRUE); g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL); gtk_widget_show_all (window); gtk_main (); return 0; } Other information:
Created attachment 104080 [details] [review] [PATCH] Do not try to stop reordering if there isn't even a tab widget. gtk/gtknotebook.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
2008-02-15 Matthias Clasen <mclasen@redhat.com> * gtk/gtknotebook.c (gtk_notebook_stop_reorder): Prevent a crash with hidden, reorderable tabs. (#513230, Mike Massonnet, patch by Carlos Garnacho)
*** Bug 518354 has been marked as a duplicate of this bug. ***