* gregor herrmann <gre...@debian.org> [120725 18:50]:
> > Gregor, would you be interested in sponsoring this upload ?
> 
> I'm a bit ambivalent; in general I'm happy to sponsor RC bug fixing
> NMUs but I'd also like to understand them :)

Sure !

> -    gtk_widget_size_request (child, requisition);
> +    gtk_widget_get_preferred_size (child, requisition, NULL);

This hunk is quite straightforward : it just uses the new API. This is
how it was done for gimp[1] or epiphany[2] for example.

[1]: https://mail.gnome.org/archives/commits-list/2012-February/msg00191.html
[2]: http://osdir.com/ml/general/2010-10/msg06642.html

The next hunk (reordered for readability) is a bit longer :

> -  gtk_paint_flat_box (gtk_widget_get_style (widget), cr, state_type, 
> shadow_type,
> -                      widget, "togglebutton", allocation.x,
> -                      allocation.y, allocation.width, allocation.height);
> +  GtkStyleContext *context = gtk_widget_get_style_context (widget);
> +  GtkStateFlags flags = 0;
> +  gtk_style_context_add_class (context, "togglebutton");
> +  switch (state_type)
> +    {
> +    case GTK_STATE_PRELIGHT:
> +      flags |= GTK_STATE_FLAG_PRELIGHT;
> +      break;
> +    case GTK_STATE_SELECTED:
> +      flags |= GTK_STATE_FLAG_SELECTED;
> +      break;
> +    case GTK_STATE_INSENSITIVE:
> +      flags |= GTK_STATE_FLAG_INSENSITIVE;
> +      break;
> +    case GTK_STATE_ACTIVE:
> +      flags |= GTK_STATE_FLAG_ACTIVE;
> +      break;
> +    case GTK_STATE_FOCUSED:
> +      flags |= GTK_STATE_FLAG_FOCUSED;
> +      break;
> +    case GTK_STATE_NORMAL:
> +    case GTK_STATE_INCONSISTENT:
> +    default:
> +      break;
> +  }
> +
> +  gtk_style_context_set_state (context, flags);
> +  gtk_render_background (context, cr, (gdouble) allocation.x, (gdouble) 
> allocation.y,
> +                                 (gdouble) allocation.width, (gdouble) 
> allocation.height);
> +  (void) shadow_type;

What gtk_paint_flat_box used to do is call the draw_flat_box struct
member of its first argument. Its default implementation is called
gtk_default_draw_flat_box (see gtk+-3.0 sources,
src/deprecated/gtkstyle.c:2036) and internally uses the new
GtkStyleContext interface.

I copied the relevant parts of this function (not perfect, I agree).
Also, shadow_type was not used, so I ignored it.

> /me interdiffs the nmudiff and the upstream patch

> Ok, I see the changes now, and from a gtk-ignorant point of view they
> don't like bad.
>
> Have you also tested the built package or could you (or someone else)
> do it to make sure it doesn't just build but also works?

I built and tested the package, and I could record my desktop using
either the command-line tool or the gnome applet.

I'm not a GTK expert either, so I may be missing something of course.

Thanks !

-- 
Etienne Millon


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to