aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui
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
commita349c25e5a83306369cc1f315e94c6e7d878376f (patch)
tree95dacaa300136137ee156db025b9096951bddd30 /ui
parentinstaller: make UpgradeCode platform-specific (diff)
downloadwireguard-windows-a349c25e5a83306369cc1f315e94c6e7d878376f.tar.xz
wireguard-windows-a349c25e5a83306369cc1f315e94c6e7d878376f.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.
Diffstat (limited to 'ui')
-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)