forked from richardwilkes/unison
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_darwin.go
More file actions
46 lines (36 loc) · 1.15 KB
/
Copy pathapp_darwin.go
File metadata and controls
46 lines (36 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright ©2021-2022 by Richard A. Wilkes. All rights reserved.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, version 2.0. If a copy of the MPL was not distributed with
// this file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// This Source Code Form is "Incompatible With Secondary Licenses", as
// defined by the Mozilla Public License, version 2.0.
package unison
import (
"time"
"github.com/go-gl/glfw/v3.3/glfw"
"github.com/richardwilkes/unison/internal/ns"
)
func platformEarlyInit() {
// macOS requires both of these hints to be set
glfw.WindowHint(glfw.OpenGLForwardCompatible, glfw.True)
glfw.WindowHint(glfw.OpenGLProfile, glfw.OpenGLCoreProfile)
ns.InstallAppDelegate(potentiallyDeferredOpenFilesHandler)
}
func platformLateInit() {
ns.InstallSystemThemeChangedCallback(ThemeChanged)
ns.SetActivationPolicy(ns.ActivationPolicyRegular)
}
func platformBeep() {
ns.Beep()
}
func platformIsDarkModeTrackingPossible() bool {
return true
}
func platformIsDarkModeEnabled() bool {
return ns.IsDarkModeEnabled()
}
func platformDoubleClickInterval() time.Duration {
return ns.DoubleClickInterval()
}