From 34f10d9cbb3a45da2ecb8a9fab60b0a5995c1a31 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 1 Mar 2022 19:33:26 +0100 Subject: [PATCH] Revert "app: [macOS] pace display link" This reverts commit 11f39582b84703c33d3aae4c1b703698a1bb4ea6 that introduced pacing of display link callbacks. Blocking the display link callback introduced deadlocks with code that updates the display link display. Not pacing the display link may introduce extra view invalidations, but invalidates are consolidated by the system and won't result in extra redraws. Fixes: https://todo.sr.ht/~eliasnaur/gio/370 Signed-off-by: Elias Naur --- app/os_macos.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/os_macos.go b/app/os_macos.go index 83a29497..832bd995 100644 --- a/app/os_macos.go +++ b/app/os_macos.go @@ -794,14 +794,10 @@ func newOSWindow() (*window, error) { view: view, scale: scale, } - done := make(chan struct{}) - setNeedsDisplay := func() { - C.setNeedsDisplay(w.view) - done <- struct{}{} - } dl, err := NewDisplayLink(func() { - w.runOnMain(setNeedsDisplay) - <-done + w.runOnMain(func() { + C.setNeedsDisplay(w.view) + }) }) w.displayLink = dl if err != nil {