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 618327 - GtkNotebookPage should be deprecated
GtkNotebookPage should be deprecated
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
2.21.x
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
deprecations
Depends on:
Blocks:
 
 
Reported: 2010-05-11 00:37 UTC by Javier Jardón (IRC: jjardon)
Modified: 2010-07-13 15:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Deprecated GtkNotebookPage (3.34 KB, patch)
2010-05-28 14:59 UTC, Christian Dywan
needs-work Details | Review
Deprecated GtkNotebookPage #2 (3.37 KB, patch)
2010-07-02 17:39 UTC, Christian Dywan
none Details | Review

Description Javier Jardón (IRC: jjardon) 2010-05-11 00:37:49 UTC
+++ This bug was initially created as a clone of Bug #613132 +++

GtkNotebook page should also be deprecated:

http://library.gnome.org/devel/gtk/unstable/GtkNotebook.html#GtkNotebookPage

It's passed as a parameter of the switch-page signal but I don't see how
anybody could be using it:
 
http://library.gnome.org/devel/gtk/unstable/GtkNotebook.html#GtkNotebook-switch-page
Comment 1 Matthias Clasen 2010-05-12 00:14:51 UTC
I agree. It should be deprecated
Comment 2 Javier Jardón (IRC: jjardon) 2010-05-22 05:24:28 UTC
"switch-page" signal should be deprecated too, then
Comment 3 Murray Cumming 2010-05-22 07:13:07 UTC
No, the signal should stay, but that parameter should be removed from it.
Comment 4 Christian Dywan 2010-05-28 14:59:41 UTC
Created attachment 162226 [details] [review]
Deprecated GtkNotebookPage

I deprecated GtkNotebook page and changed the argument in "switch-page" into a gpointer for now. I wonder if this should be a GtkWidget* in 2.90? That way, nothing will break unexpectedly and it might actually be useful.
Comment 5 Matthias Clasen 2010-05-28 15:14:48 UTC
Review of attachment 162226 [details] [review]:

Makes sense to me in general. And making it a GtkWidget * sounds good to me.

::: gtk/gtknotebook.c
@@ +6019,3 @@
   gboolean child_has_focus;
 
+  if (notebook->cur_page == page || !child)

Is this a behavior change here ?

::: gtk/gtknotebook.h
@@ +67,3 @@
+#else
+  gpointer GSEAL (cur_page);
+#endif

In master, we should just go gpointer without ifdef, I guess.
Comment 6 Matthias Clasen 2010-05-28 15:16:09 UTC
Review of attachment 162226 [details] [review]:

Makes sense to me in general. And making it a GtkWidget * sounds good to me.

::: gtk/gtknotebook.c
@@ +6019,3 @@
   gboolean child_has_focus;
 
+  if (notebook->cur_page == page || !child)

Is this a behavior change here ?

::: gtk/gtknotebook.h
@@ +67,3 @@
+#else
+  gpointer GSEAL (cur_page);
+#endif

In master, we should just go gpointer without ifdef, I guess.
Comment 7 Matthias Clasen 2010-05-28 15:16:38 UTC
Review of attachment 162226 [details] [review]:

Makes sense to me in general. And making it a GtkWidget * sounds good to me.

::: gtk/gtknotebook.c
@@ +6019,3 @@
   gboolean child_has_focus;
 
+  if (notebook->cur_page == page || !child)

Is this a behavior change here ?

::: gtk/gtknotebook.h
@@ +67,3 @@
+#else
+  gpointer GSEAL (cur_page);
+#endif

In master, we should just go gpointer without ifdef, I guess.
Comment 8 Matthias Clasen 2010-05-28 15:16:38 UTC
Review of attachment 162226 [details] [review]:

Makes sense to me in general. And making it a GtkWidget * sounds good to me.

::: gtk/gtknotebook.c
@@ +6019,3 @@
   gboolean child_has_focus;
 
+  if (notebook->cur_page == page || !child)

Is this a behavior change here ?

::: gtk/gtknotebook.h
@@ +67,3 @@
+#else
+  gpointer GSEAL (cur_page);
+#endif

In master, we should just go gpointer without ifdef, I guess.
Comment 9 Matthias Clasen 2010-05-28 15:16:38 UTC
Review of attachment 162226 [details] [review]:

Makes sense to me in general. And making it a GtkWidget * sounds good to me.

::: gtk/gtknotebook.c
@@ +6019,3 @@
   gboolean child_has_focus;
 
+  if (notebook->cur_page == page || !child)

Is this a behavior change here ?

::: gtk/gtknotebook.h
@@ +67,3 @@
+#else
+  gpointer GSEAL (cur_page);
+#endif

In master, we should just go gpointer without ifdef, I guess.
Comment 10 Matthias Clasen 2010-05-28 15:16:39 UTC
Review of attachment 162226 [details] [review]:

Makes sense to me in general. And making it a GtkWidget * sounds good to me.

::: gtk/gtknotebook.c
@@ +6019,3 @@
   gboolean child_has_focus;
 
+  if (notebook->cur_page == page || !child)

Is this a behavior change here ?

::: gtk/gtknotebook.h
@@ +67,3 @@
+#else
+  gpointer GSEAL (cur_page);
+#endif

In master, we should just go gpointer without ifdef, I guess.
Comment 11 Murray Cumming 2010-05-28 15:17:38 UTC
How does making it a (null) GtkWidget* help? GtkNotebookPage* wasn't a GtkWidget, right, so nobody can be doing anything widgety with it.
Comment 12 Christian Dywan 2010-05-28 16:47:13 UTC
(In reply to comment #11)
> How does making it a (null) GtkWidget* help? GtkNotebookPage* wasn't a
> GtkWidget, right, so nobody can be doing anything widgety with it.

It is not NULL, it is actually the GtkWidget* contained in the page. But as it would be an ABI change, it can't actually be a GtkWidget* in 2.22. So the remaining option is to pass a pointer that is as opaque as GtkNotebookPage was.
Comment 13 Christian Dywan 2010-05-28 16:51:39 UTC
(In reply to comment #10)
> Review of attachment 162226 [details] [review]:
> 
> Makes sense to me in general. And making it a GtkWidget * sounds good to me.
> 
> ::: gtk/gtknotebook.c
> @@ +6019,3 @@
>    gboolean child_has_focus;
> 
> +  if (notebook->cur_page == page || !child)
> 
> Is this a behavior change here ?

No, just used the child variable directly since it is given as a function argument now.

> ::: gtk/gtknotebook.h
> @@ +67,3 @@
> +#else
> +  gpointer GSEAL (cur_page);
> +#endif
> 
> In master, we should just go gpointer without ifdef, I guess.

The patch above is written with 2.22 in mind. In master we still need the real GtkNotebookPage* cur_page because gtknotebook.c uses it for internal book-keeping. Of course it would be hidden in a .c file or private header then.
Comment 14 Matthias Clasen 2010-07-02 16:45:40 UTC
(In reply to comment #13)
> (In reply to comment #10)
> > Review of attachment 162226 [details] [review] [details]:
> > 
> > Makes sense to me in general. And making it a GtkWidget * sounds good to me.
> > 
> > ::: gtk/gtknotebook.c
> > @@ +6019,3 @@
> >    gboolean child_has_focus;
> > 
> > +  if (notebook->cur_page == page || !child)
> > 
> > Is this a behavior change here ?
>
> No, just used the child variable directly since it is given as a function
> argument now.

But the code used to check gtk_widget_get_visible, not it just checks != NULL.
That smells like a behaviour change to me...
Comment 15 Christian Dywan 2010-07-02 17:39:02 UTC
Created attachment 165129 [details] [review]
Deprecated GtkNotebookPage #2

You are absolutely right, the quoting from the review confused me. I updated the patch.
Comment 16 Matthias Clasen 2010-07-06 19:11:44 UTC
Looks ok to me now, assuming you've tested that things still work with that.
Comment 17 Christian Dywan 2010-07-13 15:07:58 UTC
I tested it, committed to gtk-2-22, (accidentally also master) and also change it in master to use GtkWidget* now.