From f6d6d2ad82de50bc7ec39fc7046671e2922cf8ac Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Mon, 19 Aug 2024 08:08:01 -0700 Subject: [PATCH] move event polling back to 60 fps on arm Mac --- internal/driver/glfw/loop.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/driver/glfw/loop.go b/internal/driver/glfw/loop.go index a35eb897cc..479717c853 100644 --- a/internal/driver/glfw/loop.go +++ b/internal/driver/glfw/loop.go @@ -118,10 +118,13 @@ func (d *gLDriver) runGL() { go f() // don't block main, we don't have window event queue } - // reduce background CPU by polling less frequently - // will only affect animation smoothness on ARM Mac (drawOnMainThread) - eventTick := time.NewTicker(time.Second / 30) - //eventTick := time.NewTicker(time.Second / 60) + // reduce background CPU by polling less frequently on non-ARM Mac + // would affect animation smoothness on ARM Mac (drawOnMainThread) + tickTime := time.Second / 30 + if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" { + tickTime = time.Second / 60 + } + eventTick := time.NewTicker(tickTime) for { select {