gtk_style_context_get_border uses the state wherever it's available now.
> I suspect all the gtk_style_context_set_state(style, GTK_STATE_FLAG_NORMAL)
> calls are unnecessary. The pattern used in GTK is to create the style context
> with default state and only ever set the state with a save/restore during
> draw. Removing these would save a little code, but I don't feel strongly
> about it, if you prefer to leave them in.
I prefer to leave GTK_STATE_FLAG_NORMAL here for now, we can remove it / optimize later.
I recall there were issues with rendering when GTK_STATE_FLAG_NORMAL was missing.
> With the API change from a cliprect parameter to a cairo_t, the clip
> rectangles for each half will need to be applied to the cairo_t,
> necessitating the use of cairo_save/restore. I suggest dividing rect into
> left and right halves instead of the approach for gtk2 of dividing the
> cliprect into two halves. (Getting the cliprect from cairo is harder and
> unnecessary.)
> For smaller tabpanels, the logic in the gtk2 port could lead to the gap being
> outside the rect. I suggest just using rect->width as the gap position in the
> render_frame_gap() call for the left half and 0 for the right half.
Created attachment 565519
gtk drawing patch v.3
gtk_style_ context_ get_border uses the state wherever it's available now.
> I suspect all the gtk_style_ context_ set_state( style, GTK_STATE_ FLAG_NORMAL)
> calls are unnecessary. The pattern used in GTK is to create the style context
> with default state and only ever set the state with a save/restore during
> draw. Removing these would save a little code, but I don't feel strongly
> about it, if you prefer to leave them in.
I prefer to leave GTK_STATE_ FLAG_NORMAL here for now, we can remove it / optimize later. FLAG_NORMAL was missing.
I recall there were issues with rendering when GTK_STATE_
> With the API change from a cliprect parameter to a cairo_t, the clip
> rectangles for each half will need to be applied to the cairo_t,
> necessitating the use of cairo_save/restore. I suggest dividing rect into
> left and right halves instead of the approach for gtk2 of dividing the
> cliprect into two halves. (Getting the cliprect from cairo is harder and
> unnecessary.)
> For smaller tabpanels, the logic in the gtk2 port could lead to the gap being
> outside the rect. I suggest just using rect->width as the gap position in the
> render_frame_gap() call for the left half and 0 for the right half.
Updated. I hope I grasp the idea correctly.