mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
app: [macOS] don't draw when minimized
References: https://todo.sr.ht/~eliasnaur/gio/621 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+8
-1
@@ -320,6 +320,13 @@ static void interpretKeyEvents(CFTypeRef viewRef, CFTypeRef eventRef) {
|
|||||||
[view interpretKeyEvents:[NSArray arrayWithObject:event]];
|
[view interpretKeyEvents:[NSArray arrayWithObject:event]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int isMiniaturized(CFTypeRef windowRef) {
|
||||||
|
@autoreleasepool {
|
||||||
|
NSWindow *window = (__bridge NSWindow *)windowRef;
|
||||||
|
return window.miniaturized ? 1 : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
@@ -543,7 +550,7 @@ func (w *window) SetInputHint(_ key.InputHint) {}
|
|||||||
func (w *window) SetAnimating(anim bool) {
|
func (w *window) SetAnimating(anim bool) {
|
||||||
w.anim = anim
|
w.anim = anim
|
||||||
window := C.windowForView(w.view)
|
window := C.windowForView(w.view)
|
||||||
if w.anim && window != 0 {
|
if w.anim && window != 0 && C.isMiniaturized(window) == 0 {
|
||||||
w.displayLink.Start()
|
w.displayLink.Start()
|
||||||
} else {
|
} else {
|
||||||
w.displayLink.Stop()
|
w.displayLink.Stop()
|
||||||
|
|||||||
Reference in New Issue
Block a user