ceecbb6af4
General - 配置界面支持配置对象存储桶 - 快捷键进入截图 - 一键上传截图 & 复制截图链接 MacOS - 状态栏指示器和应用图标
15 lines
544 B
Go
15 lines
544 B
Go
// flush_frame.go provides a tiny helper that yields the current goroutine
|
|
// long enough for the OS compositor to redraw after WindowHide / Unfullscreen.
|
|
//
|
|
// Without this, the screenshot can include the just-hidden overlay window
|
|
// because Cocoa hasn't redrawn yet by the time we ask for the pixels.
|
|
package main
|
|
|
|
import "time"
|
|
|
|
func flushFrame() {
|
|
// 80ms is empirically enough on Apple Silicon at 120Hz; on slower devices
|
|
// the worst case is a single redraw delay, still imperceptible to the user.
|
|
time.Sleep(80 * time.Millisecond)
|
|
}
|