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 386930 - GtkNotebook group IDs suffer from possible namespace collision
GtkNotebook group IDs suffer from possible namespace collision
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
2.10.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 386935
Blocks:
 
 
Reported: 2006-12-17 20:50 UTC by Christian Hammond
Modified: 2007-05-19 05:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Hammond 2006-12-17 20:50:16 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.
Comment 1 Matthias Clasen 2007-05-19 05:21:13 UTC
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.