5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 21:10:54 +08:00

Ensure Focus is regained by Webview2 when tabbing (#1257)

This commit is contained in:
Lea Anthony 2022-03-15 20:15:21 +11:00 committed by GitHub
parent 3972093ede
commit 60c6dce07d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -22,7 +22,7 @@ require (
github.com/leaanthony/debme v1.2.1
github.com/leaanthony/go-ansi-parser v1.0.1
github.com/leaanthony/go-common-file-dialog v1.0.3
github.com/leaanthony/go-webview2 v1.0.3-0.20220125181555-00f20a61c17d
github.com/leaanthony/go-webview2 v1.0.3-0.20220314105146-f44268990abe
github.com/leaanthony/gosod v1.0.3
github.com/leaanthony/idgen v1.0.0
github.com/leaanthony/slicer v1.5.0

View File

@ -118,8 +118,8 @@ github.com/leaanthony/go-ansi-parser v1.0.1 h1:97v6c5kYppVsbScf4r/VZdXyQ21KQIfeQ
github.com/leaanthony/go-ansi-parser v1.0.1/go.mod h1:7arTzgVI47srICYhvgUV4CGd063sGEeoSlych5yeSPM=
github.com/leaanthony/go-common-file-dialog v1.0.3 h1:O0uGjKnWtdEADGrkg+TyAAbZylykMwwx/MNEXn9fp+Y=
github.com/leaanthony/go-common-file-dialog v1.0.3/go.mod h1:TGhEc9eSJgRsupZ+iH1ZgAOnEo9zp05cRH2j08RPrF0=
github.com/leaanthony/go-webview2 v1.0.3-0.20220125181555-00f20a61c17d h1:xJZ3wwHc0BgvXz3NL2PUMGa3Ee4jPuTFeK/N7LDnV74=
github.com/leaanthony/go-webview2 v1.0.3-0.20220125181555-00f20a61c17d/go.mod h1:iX54IaVk1FnDqMuHJ47VYLPQOcVqQiOe9SJACt9CAbU=
github.com/leaanthony/go-webview2 v1.0.3-0.20220314105146-f44268990abe h1:8MRHsDSWiVHE5FIwyXKBTtdOGMQEOfmPNF1nGcbx3iY=
github.com/leaanthony/go-webview2 v1.0.3-0.20220314105146-f44268990abe/go.mod h1:iX54IaVk1FnDqMuHJ47VYLPQOcVqQiOe9SJACt9CAbU=
github.com/leaanthony/gosod v1.0.3 h1:Fnt+/B6NjQOVuCWOKYRREZnjGyvg+mEhd1nkkA04aTQ=
github.com/leaanthony/gosod v1.0.3/go.mod h1:BJ2J+oHsQIyIQpnLPjnqFGTMnOZXDbvWtRCSG7jGxs4=
github.com/leaanthony/idgen v1.0.0 h1:IZreR+JGEzFV4yeVuBZA25gM0keUoFy+RDUldncQ+Jw=

View File

@ -322,6 +322,10 @@ func (f *Frontend) setupChromium() {
log.Fatal(err)
}
// Setup focus event handler
onFocus := f.mainWindow.OnSetFocus()
onFocus.Bind(f.onFocus)
// Set background colour
f.WindowSetRGBA(f.frontendOptions.RGBA)
@ -527,3 +531,7 @@ func (f *Frontend) navigationCompleted(sender *edge.ICoreWebView2, args *edge.IC
}
}
func (f *Frontend) onFocus(arg *winc.Event) {
f.chromium.Focus()
}