5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 00:09:56 +08:00

Updated windows window/frontend to fix issue with html select positioning (#1082)

* Updated windows window/frontend to fix issue with html select positioning

* Moved notifyParentWindowPositionChanged to the Window struct and moved RegMsgHandler to Run

* Update v2/internal/frontend/desktop/windows/window.go

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>

* Moved winc.RegMsgHandler back to old location

* fixed error with merge

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
MikeSchaap 2022-01-26 08:48:39 +01:00 committed by GitHub
parent aa88174c28
commit 965187a8bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -116,6 +116,8 @@ func (f *Frontend) Run(ctx context.Context) error {
f.WindowCenter()
f.setupChromium()
f.mainWindow.notifyParentWindowPositionChanged = f.chromium.NotifyParentWindowPositionChanged
mainWindow.OnSize().Bind(func(arg *winc.Event) {
f.chromium.Resize()
})
@ -133,7 +135,6 @@ func (f *Frontend) Run(ctx context.Context) error {
f.frontendOptions.OnStartup(f.ctx)
}
}()
mainWindow.Run()
mainWindow.Close()
return nil

View File

@ -18,6 +18,7 @@ type Window struct {
winc.Form
frontendOptions *options.App
applicationMenu *menu.Menu
notifyParentWindowPositionChanged func() error
}
func NewWindow(parent winc.Controller, appoptions *options.App) *Window {
@ -89,6 +90,16 @@ func (w *Window) Run() int {
}
func (w *Window) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
switch msg {
case w32.WM_NCLBUTTONDOWN:
w32.SetFocus(w.Handle())
case w32.WM_MOVE, w32.WM_MOVING:
if w.notifyParentWindowPositionChanged != nil {
w.notifyParentWindowPositionChanged()
}
}
if w.frontendOptions.Frameless {
switch msg {
case w32.WM_ACTIVATE: