I am trying to push Shotwell to GTK4 currently, which surprisingly works smoother than I anticipated.
I have stumbled over one thing, though. With GTK3 I am using gtk_render_background/gtk_render_frame on a style context with the class “rubberband” to draw a selection rubberband on a DrawingArea. I think I stole that from libgd:
get_style_context().save();
get_style_context().add_class("rubberband");
// pixelate selection rectangle interior
if (visible_band.width > 1 && visible_band.height > 1) {
get_style_context().render_background(ctx, visible_band.x, visible_band.y, visible_band.width, visible_band.height);
}
// border
get_style_context().render_frame(ctx, visible_band.x, visible_band.y, visible_band.width, visible_band.height);
get_style_context().restore();
In principle that still works fine, but instead of a rubberband I get an opaque rectangle in background color. What am I missing here?