aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-07-17 16:04:50 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-07-17 16:05:08 +0200
commit26dead7ea4dab8c3cacf81d533444550891177ef (patch)
tree72d4ada310639b6d91a526857bc42902434e0231
parent94f6938b9abfb7f66df632aa94775e0c5e8d6c17 (diff)
downloadfiv-26dead7ea4dab8c3cacf81d533444550891177ef.tar.gz
fiv-26dead7ea4dab8c3cacf81d533444550891177ef.tar.xz
fiv-26dead7ea4dab8c3cacf81d533444550891177ef.zip
Fix the About dialog animation on macOS
-rw-r--r--fiv.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fiv.c b/fiv.c
index 9f0af5e..7599105 100644
--- a/fiv.c
+++ b/fiv.c
@@ -360,6 +360,12 @@ on_about_draw(GtkWidget *widget, cairo_t *cr, gpointer user_data)
GtkStyleContext *style = gtk_widget_get_style_context(widget);
gtk_render_background(style, cr, 0, 0, allocation.width, allocation.height);
+ // The transformation matrix turns out/is applied wrongly on Quartz.
+ gboolean broken_backend = cairo_surface_get_type(cairo_get_target(cr)) ==
+ CAIRO_SURFACE_TYPE_QUARTZ;
+ if (broken_backend)
+ cairo_push_group(cr);
+
cairo_translate(cr, (allocation.width - ABOUT_SIZE * ABOUT_SCALE) / 2,
ABOUT_SIZE * ABOUT_SCALE / 4);
cairo_scale(cr, ABOUT_SCALE, ABOUT_SCALE);
@@ -385,6 +391,11 @@ on_about_draw(GtkWidget *widget, cairo_t *cr, gpointer user_data)
cairo_restore(cr);
draw_ligature(cr);
+
+ if (broken_backend) {
+ cairo_pop_group_to_source(cr);
+ cairo_paint(cr);
+ }
return TRUE;
}