mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
app/internal/window: [macOS] move main thread dispatching to Go
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -148,9 +148,7 @@ void gio_updateDisplayLink(CFTypeRef viewRef, CGDirectDisplayID dispID) {
|
||||
|
||||
void gio_setAnimating(CFTypeRef viewRef, BOOL anim) {
|
||||
GioView *view = (__bridge GioView *)viewRef;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[view setAnimating:anim];
|
||||
});
|
||||
[view setAnimating:anim];
|
||||
}
|
||||
|
||||
CFTypeRef gio_contextForView(CFTypeRef viewRef) {
|
||||
|
||||
@@ -86,7 +86,12 @@ func (w *window) SetAnimating(anim bool) {
|
||||
if anim {
|
||||
animb = 1
|
||||
}
|
||||
C.gio_setAnimating(w.view, animb)
|
||||
v := w.view
|
||||
C.CFRetain(v)
|
||||
runOnMain(func() {
|
||||
defer C.CFRelease(v)
|
||||
C.gio_setAnimating(v, animb)
|
||||
})
|
||||
}
|
||||
|
||||
func (w *window) setStage(stage system.Stage) {
|
||||
|
||||
Reference in New Issue
Block a user