Skip to content

Commit

Permalink
[Widget] Don't use cairo_push/pop_group as it causes issues.
Browse files Browse the repository at this point in the history
Seems to happen on nvidia systems, rendering to PNG surface is fine,
problem is with rendering to screen.
Hopefully this patch fixes it.

Issue: #2068
  • Loading branch information
DaveDavenport committed Jan 3, 2025
1 parent 496101a commit 3b1e483
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions source/widgets/widget.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ void widget_draw(widget *wid, cairo_t *d) {
cairo_restore(d);

if (left != 0 || top != 0 || right != 0 || bottom != 0) {
// NOTE: Cairo group push/pop has same effect as cairo_save/cairo_restore,
// thus no need for these.
cairo_push_group(d);
cairo_save(d);
cairo_set_operator(d, CAIRO_OPERATOR_ADD);
cairo_translate(d, wid->x, wid->y);
cairo_new_path(d);
Expand Down Expand Up @@ -409,8 +407,7 @@ void widget_draw(widget *wid, cairo_t *d) {

cairo_fill(d);
}
cairo_pop_group_to_source(d);
cairo_paint(d);
cairo_restore(d);
}
}
}
Expand Down

0 comments on commit 3b1e483

Please sign in to comment.