From f635b57b8ddc03776b5ead37af7bd0aacbe1e447 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sun, 11 Mar 2018 15:59:57 -0700 Subject: [PATCH] gtk (surface-ink-flush): Use with-glib-lock. Signal-thread-event is too asynchronous, catching glib-thread without its glib-mutex lock. --- src/gtk/fix-layout.scm | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/gtk/fix-layout.scm b/src/gtk/fix-layout.scm index d371f304c..c74ab3b42 100644 --- a/src/gtk/fix-layout.scm +++ b/src/gtk/fix-layout.scm @@ -1794,19 +1794,18 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. surface))))) (define (surface-ink-flush ink) - (let ((surface (surface-ink-surface ink)) - (exposed (surface-ink-exposed ink))) + (let ((surface (surface-ink-surface ink))) (cairo-surface-flush surface) - (if exposed - (signal-thread-event glib-thread - (lambda () - (%trace2 ";surface-ink-flush copying\n") - (let ((cr (cairo-create exposed))) - (cairo-set-source-surface cr surface 0 0) - (cairo-paint cr) - (cairo-destroy cr)) - (cairo-surface-flush exposed)))) - (drawing-damage ink))) + (with-glib-lock + (lambda () + (let ((exposed (surface-ink-exposed ink))) + (if exposed + (let ((cr (cairo-create exposed))) + (cairo-set-source-surface cr surface 0 0) + (cairo-paint cr) + (cairo-destroy cr) + (cairo-surface-flush exposed))) + (drawing-damage ink)))))) (define (set-surface-ink-position! ink x y) (set-fix-rect-position! (fix-ink-extent ink) x y)) -- 2.25.1