aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-08-26 10:47:20 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2019-08-26 14:48:41 -0600
commitb81b7951cb01a267766c38b9774dea6c3713d7ac (patch)
tree6e71068ee9104c25997a681da9a1e6334f3c6003 /ui
parentelevate: mark as terminal services aware (diff)
downloadwireguard-windows-b81b7951cb01a267766c38b9774dea6c3713d7ac.tar.xz
wireguard-windows-b81b7951cb01a267766c38b9774dea6c3713d7ac.zip
ui: enable priority boost
This makes things a bit more responsive, despite causing some minor issues for Go timers.
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/ui.go b/ui/ui.go
index c98edf18..49e90007 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -13,6 +13,7 @@ import (
"github.com/lxn/walk"
"github.com/lxn/win"
+ "golang.org/x/sys/windows"
"golang.zx2c4.com/wireguard/windows/manager"
"golang.zx2c4.com/wireguard/windows/version"
@@ -24,6 +25,8 @@ var startTime = time.Now()
func RunUI() {
runtime.LockOSThread()
+ thisProcess, _ := windows.GetCurrentProcess()
+ windows.SetProcessPriorityBoost(thisProcess, false)
defer func() {
if err := recover(); err != nil {
showErrorCustom(nil, "Panic", fmt.Sprint(err, "\n\n", string(debug.Stack())))