From d8fbf4a6e139633cb91ef247cffd6c5177089d8b Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sun, 11 Mar 2018 15:34:01 -0700 Subject: [PATCH] cairo: Avoid locking glib by looking up color names elsewhere. --- src/cairo/cairo.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cairo/cairo.scm b/src/cairo/cairo.scm index 06ad9395d..e6bd01114 100644 --- a/src/cairo/cairo.scm +++ b/src/cairo/cairo.scm @@ -124,7 +124,10 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (define (cairo-pattern-add-color-stop pattern offset color) (guarantee-cairo-pattern pattern 'cairo-pattern-add-color-stop) - (let ((c (->color color 'cairo-pattern-add-color-stop))) + (let ((c (if (color? color) + color + (with-glib-lock + (lambda () (->color color 'cairo-pattern-add-color-stop)))))) (C-call "cairo_pattern_add_color_stop_rgba" pattern (->flonum offset) (color-red c) (color-green c) (color-blue c) (color-alpha c)))) @@ -183,7 +186,10 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (define (cairo-set-source-color cairo color) (guarantee-cairo cairo 'cairo-set-source-color) - (let ((c (->color color 'cairo-set-source-color))) + (let ((c (if (color? color) + color + (with-glib-lock + (lambda () (->color color 'cairo-set-source-color)))))) (C-call "cairo_set_source_rgba" cairo (color-red c) (color-green c) (color-blue c) (color-alpha c)))) -- 2.25.1