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 96834 - Remove notebook->focus_tab
Remove notebook->focus_tab
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
3.1.x
Other All
: Low minor
: Small fix
Assigned To: gtk-bugs
gtk-bugs
deprecations
Depends on:
Blocks:
 
 
Reported: 2002-10-25 21:59 UTC by Owen Taylor
Modified: 2018-05-02 13:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to remove notebook->focus_tab (53.49 KB, patch)
2013-04-05 13:18 UTC, Timm Bäder
none Details | Review
Proposed patch v2 (51.60 KB, patch)
2015-10-11 18:10 UTC, Ernestas Kulik
none Details | Review
Proposed patch v2.1 (52.04 KB, patch)
2015-10-11 18:31 UTC, Ernestas Kulik
none Details | Review

Description Owen Taylor 2002-10-25 21:59:48 UTC
The focus_tab field in GtkNotebook is now obsolete because
the focus tab is now always identical to the current page.
A lot of code in gtknotebook.c could be removed because
of this simplification.
Comment 1 Owen Taylor 2002-10-25 22:01:56 UTC
See bug 82108 for information about the change making
focus_tab unneccesary.
Comment 2 Timm Bäder 2013-04-05 13:18:34 UTC
Created attachment 240742 [details] [review]
Patch to remove notebook->focus_tab

  I played around with this the last few days and I've come up with the attached patch.
Basically, I did not remove focus_tab but rather cur_page and replace focus_tab with cur_tab.
I'm not particularly happy about the _GTK_NOTEBOOK_PAGE define(it only exists because calling
->data obv. fails if cur_tab is NULL). I removed gtk_notebook_switch_focus_tab and
gtk_notebook_switch_page now takes a GList* instead of a GtkNotebookPage*, which removed a few
g_list_find calls.
  I tested it by manually launching tests/testnotebookdnd and comparing the behavior to the
testnotebookdnd from master, fixed a few bugs but now I *think* they are the same.
  I don't think the removed 30 lines are really what was meant with the "lot of code", so
I'd be happy to hear what else can be removed.
Comment 3 Timm Bäder 2015-08-10 13:02:16 UTC
The patch above probably does not apply anymore and it's very likely wrong, but if anyone wants to fix this gnome-love bug: you can use it as a base and fix it up. Or just do it on your own of course.
Comment 4 Ernestas Kulik 2015-10-11 18:10:09 UTC
Created attachment 313068 [details] [review]
Proposed patch v2

The end result is pretty much the same, although my use of the GTK_NOTEBOOK_PAGE() macro is more liberal. I also replaced the macro entirely with one that has a null check.
There seem to be no noticable regressions on my end.
Comment 5 Ernestas Kulik 2015-10-11 18:31:51 UTC
Created attachment 313071 [details] [review]
Proposed patch v2.1
Comment 6 GNOME Infrastructure Team 2018-05-02 13:46:21 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/223.