From 86383052f8889d9e2ba5dfae7c9483e0929e7a62 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 12 May 2019 13:02:02 +0200 Subject: 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 --- ui/raise.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ui') 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) -- cgit v1.2.3-59-g8ed1b