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 782396 - Inconsistent deprecation documentation for gtk_paint_spinner
Inconsistent deprecation documentation for gtk_paint_spinner
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Documentation
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-05-09 17:15 UTC by Debarshi Ray
Modified: 2017-10-10 09:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
docs: Update the deprecation annotation for gtk_paint_spinner() (958 bytes, patch)
2017-09-07 09:47 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
docs: Make the gtk_paint_spinner deprecation notice consistent (850 bytes, patch)
2017-09-07 09:53 UTC, Debarshi Ray
none Details | Review

Description Debarshi Ray 2017-05-09 17:15:45 UTC
There are conflicting suggestions about replacing gtk_paint_spinner.

This suggests using gtk_render_icon instead:

GDK_DEPRECATED_IN_3_0_FOR(GtkStyleContext and gtk_render_icon)
void gtk_paint_spinner           (GtkStyle           *style,
                                  cairo_t            *cr,
                                  GtkStateType        state_type,
                                  GtkWidget          *widget,
                                  const gchar        *detail,
                                  guint               step,
                                  gint                x,
                                  gint                y,
                                  gint                width,
                                  gint                height);

While this suggests using gtk_render_activity:

/**                                                        
 * gtk_paint_spinner:
 * @style: a #GtkStyle
 * @cr: a #cairo_t
 * @state_type: a state
 * @widget: (allow-none): the widget (may be %NULL)
 * @detail: (allow-none): a style detail (may be %NULL)
 * @step: the nth step
 * @x: the x origin of the rectangle in which to draw the spinner
 * @y: the y origin of the rectangle in which to draw the spinner
 * @width: the width of the rectangle in which to draw the spinner
 * @height: the height of the rectangle in which to draw the spinner
 *
 * Draws a spinner on @window using the given parameters.
 *
 * Deprecated:3.0: Use gtk_render_activity() instead
 */
Comment 1 Daniel Boles 2017-09-07 07:26:22 UTC
The comment in the header file is newer, but it may have just been an oversight. The comment in the source file seems a more direct replacement
Comment 2 Debarshi Ray 2017-09-07 09:32:54 UTC
Except gtk_paint_spinner cannot be replaced with gtk_render_activity. I tried to do that for GdTogglePixbufRenderer (bug 782023), and I think that's why GtkCellRendererSpinner also continues to use gtk_paint_spinner.

Or maybe I am missing something?

(I dream of the day when we'll have scalable List/FlowBoxes and cell renderers would be a thing of the past. :)
Comment 3 Daniel Boles 2017-09-07 09:43:02 UTC
Ah, OK. The problem was it didn't spin, right? That's probably lack of support for states or animation on CellRenderers.

Various less-popular widgets kind of support CSS, but fall over when asked to do certain things. I noticed CellRenderers seem to cache an old currentColor rather than it being current, for example. Also, I've noticed problems with animation (e.g. bg colour on an entry selection) though I didn't try it on a CellRenderer.

I guess these are because the widgets simply can't do what's asked, but I may be wrong.

I presume gtk_render_icon() was equally ineffective in your case?
Comment 4 Emmanuele Bassi (:ebassi) 2017-09-07 09:45:01 UTC
For all intents and purposes, nobody should ever use gtk_paint_spinner() in newly written code. Sadly, cell renderers are not "newly written code", so you'll have to live with the deprecated API.

For GTK+ 4.0 we'll have to figure out a way to use render nodes with cell renderers, so the advice to stop using gtk_paint_spinner() will also apply to them.

In any case, the documentation stanza should be updated to reflect the annotation in the header.
Comment 5 Emmanuele Bassi (:ebassi) 2017-09-07 09:47:33 UTC
Created attachment 359328 [details] [review]
docs: Update the deprecation annotation for gtk_paint_spinner()

Bring it in line with the deprecation warning in the header.
Comment 6 Debarshi Ray 2017-09-07 09:53:13 UTC
Created attachment 359329 [details] [review]
docs: Make the gtk_paint_spinner deprecation notice consistent

Only for gtk-3-22, because gtk_paint_spinner is no longer public API in gtk-4.x.
Comment 7 Debarshi Ray 2017-09-07 09:53:53 UTC
Comment on attachment 359329 [details] [review]
docs: Make the gtk_paint_spinner deprecation notice consistent

Oops! Sorry. :)
Comment 8 Debarshi Ray 2017-09-07 09:55:04 UTC
(In reply to Daniel Boles from comment #3)
> Ah, OK. The problem was it didn't spin, right? That's probably lack of
> support for states or animation on CellRenderers.

Yes, it didn't spin.

> I presume gtk_render_icon() was equally ineffective in your case?

Umm... probably. It was a while ago and I don't remember.
Comment 9 Debarshi Ray 2017-09-07 09:55:37 UTC
(In reply to Daniel Boles from comment #3)
> Various less-popular widgets kind of support CSS, but fall over when asked
> to do certain things. I noticed CellRenderers seem to cache an old
> currentColor rather than it being current, for example. Also, I've noticed
> problems with animation (e.g. bg colour on an entry selection) though I
> didn't try it on a CellRenderer.
> 
> I guess these are because the widgets simply can't do what's asked, but I
> may be wrong.

(In reply to Emmanuele Bassi (:ebassi) from comment #4)
> For all intents and purposes, nobody should ever use gtk_paint_spinner() in
> newly written code. Sadly, cell renderers are not "newly written code", so
> you'll have to live with the deprecated API.
> 
> For GTK+ 4.0 we'll have to figure out a way to use render nodes with cell
> renderers, so the advice to stop using gtk_paint_spinner() will also apply
> to them.

I see, ok. Thanks for the explanation.
Comment 10 Emmanuele Bassi (:ebassi) 2017-10-10 09:55:01 UTC
Attachment 359328 [details] pushed as e06bce7 - docs: Update the deprecation annotation for gtk_paint_spinner()