GNOME Bugzilla – Bug 386930
GtkNotebook group IDs suffer from possible namespace collision
Last modified: 2007-05-19 05:21:13 UTC
gtk_notebook_set_group_id suffers from namespace collision issues. The group ID is just an unsigned integer and there is no way of guaranteeing that two authors of, say, plugins won't choose the same group ID for two completely different set of notebooks. I propose that we instead provide a simple GtkNotebookGroup type (it can be a typedef or a struct, doesn't really matter) and offer a new gtk_notebook_set_group that takes a pointer to one of these. Applications can create a static GtkNotebookGroup in their file handling window and notebook creation and pass that along. The same group would be used for each of the notebooks, and the developer wouldn't have to worry about colliding with some plugin or another part of the program. Of course, we still have to support gtk_notebook_set_group_id, so that should be used as a fallback. We could have gtk_notebook_set_group_id spit out a warning message to the console indicating that the function is deprecated and that gtk_notebook_set_group should be used. I plan to have a patch for this over the Christmas break, if not sooner.
2007-05-19 Matthias Clasen <mclasen@redhat.com> * gtk/gtk.symbols: * gtk/gtknotebook.[hc]: Deprecate gtk_notebook_[gs]et_group_id in favour of new functions gtk_notebook_[gs]et_group, which takes a pointer as group identifier and makes it easier to avoid group id collisions. (#386930, Christian Hammond) * tests/testnotebookdnd.c: Use new grouping api.