aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/raise.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-12 13:02:02 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-13 13:28:00 +0200
commit86383052f8889d9e2ba5dfae7c9483e0929e7a62 (patch)
tree95dacaa300136137ee156db025b9096951bddd30 /ui/raise.go
parentinstaller: make UpgradeCode platform-specific (diff)
downloadwireguard-windows-86383052f8889d9e2ba5dfae7c9483e0929e7a62.tar.xz
wireguard-windows-86383052f8889d9e2ba5dfae7c9483e0929e7a62.zip
ui: give foreground status to foreign process in raise
While UIPI prevents us from sending real window messages, we can at least give the foreground privilege to the other process, which lets it then actually come in front as it wants. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/raise.go')
-rw-r--r--ui/raise.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/raise.go b/ui/raise.go
index 7bc916a3..6d08c6bb 100644
--- a/ui/raise.go
+++ b/ui/raise.go
@@ -33,6 +33,7 @@ func RaiseUI() bool {
return false
}
win.SendMessage(hwnd, raiseMsg, 0, 0)
+ win.SetForegroundWindow(hwnd)
return true
}
@@ -48,6 +49,7 @@ func WaitForRaiseUIThenQuit() {
}
win.UnhookWinEvent(handle)
win.SendMessage(hwnd, raiseMsg, 0, 0)
+ win.SetForegroundWindow(hwnd)
os.Exit(0)
return 0
}, 0, 0, win.WINEVENT_SKIPOWNPROCESS|win.WINEVENT_OUTOFCONTEXT)