aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/ui.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-10 23:41:22 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-12 03:07:59 -0600
commit3b040a454ae7456a0c3c3945dc23ca4f6cd8ca23 (patch)
tree1d79400d15c0d93675e23e2d620c9750d47ed773 /ui/ui.go
parentui: initial stab at a better confview (diff)
downloadwireguard-windows-3b040a454ae7456a0c3c3945dc23ca4f6cd8ca23.tar.xz
wireguard-windows-3b040a454ae7456a0c3c3945dc23ca4f6cd8ca23.zip
ui: reduce flicker when changing view
Diffstat (limited to 'ui/ui.go')
-rw-r--r--ui/ui.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/ui.go b/ui/ui.go
index 66c5fc12..85aba1e0 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -128,7 +128,6 @@ func RunUI() {
if on {
updateConfView()
}
- mw.Invalidate()
}
pb, _ := walk.NewPushButton(mw)
@@ -145,9 +144,12 @@ func RunUI() {
pb.SetText(pbT)
}
}()
+
+ mw.SetSuspended(true)
pb.SetEnabled(false)
se.SetEnabled(false)
pb.SetText("Requesting..")
+ mw.SetSuspended(false)
if runningTunnel != nil {
err := runningTunnel.Stop()
if err != nil {
@@ -202,6 +204,7 @@ func RunUI() {
if tunnel.Name != "test" {
return
}
+ mw.SetSuspended(true)
//TODO: also set tray icon to reflect state
switch state {
case service.TunnelStarting:
@@ -241,6 +244,7 @@ func RunUI() {
tray.ShowInfo("WireGuard Deactivated", fmt.Sprintf("The %s tunnel has been deactivated.", tunnel.Name))
}
}
+ mw.SetSuspended(false)
}
service.IPCClientRegisterTunnelChange(func(tunnel *service.Tunnel, state service.TunnelState, err error) {
setServiceState(tunnel, state, err == nil)