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 513230 - Crash when using _set_tab_reorderable but tabs are hidden
Crash when using _set_tab_reorderable but tabs are hidden
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
2.12.x
Other All
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 518354 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-01-30 19:09 UTC by Mike Massonnet
Modified: 2008-02-28 06:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] Do not try to stop reordering if there isn't even a tab widget. (377 bytes, patch)
2008-01-30 23:33 UTC, Carlos Garnacho
committed Details | Review

Description Mike Massonnet 2008-01-30 19:09:43 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:
Comment 1 Carlos Garnacho 2008-01-30 23:33:27 UTC
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(-)
Comment 2 Matthias Clasen 2008-02-16 04:09:31 UTC
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)
Comment 3 Christian Persch 2008-02-24 18:15:42 UTC
*** Bug 518354 has been marked as a duplicate of this bug. ***