From 71f834d26f6b6cf6372df8fb2850726c38f392bf Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 16 Aug 2021 15:44:48 +0200 Subject: [PATCH] app/internal/wm: remove superfluous main thread switching The affected code paths are guaranteed to be run on the main thread by the app.Window callers. Signed-off-by: Elias Naur --- app/internal/wm/os_darwin.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/internal/wm/os_darwin.go b/app/internal/wm/os_darwin.go index 7e8d3cd5..7c170f15 100644 --- a/app/internal/wm/os_darwin.go +++ b/app/internal/wm/os_darwin.go @@ -220,17 +220,13 @@ func windowSetCursor(from, to pointer.CursorName) pointer.CursorName { case pointer.CursorGrab: curID = 7 case pointer.CursorNone: - runOnMain(func() { - C.gio_hideCursor() - }) + C.gio_hideCursor() return to } - runOnMain(func() { - if from == pointer.CursorNone { - C.gio_showCursor() - } - C.gio_setCursor(C.NSUInteger(curID)) - }) + if from == pointer.CursorNone { + C.gio_showCursor() + } + C.gio_setCursor(C.NSUInteger(curID)) return to }