aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui/ui.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui/ui.go')
-rw-r--r--lib/ui/ui.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/ui/ui.go b/lib/ui/ui.go
index c20eac37..3680fb1a 100644
--- a/lib/ui/ui.go
+++ b/lib/ui/ui.go
@@ -99,6 +99,19 @@ func QueueSuspend() {
}
}
+// SuspendScreen should be called from the main thread.
+func SuspendScreen() {
+ _ = state.vx.Suspend()
+}
+
+func ResumeScreen() {
+ err := state.vx.Resume()
+ if err != nil {
+ log.Errorf("ui: cannot resume after suspend: %v", err)
+ }
+ Invalidate()
+}
+
func Suspend() error {
var err error
if atomic.SwapUint32(&state.suspending, 0) != 0 {