mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 22:31:06 +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:
parent
aa88174c28
commit
965187a8bb
@ -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
|
||||
|
@ -16,8 +16,9 @@ import (
|
||||
|
||||
type Window struct {
|
||||
winc.Form
|
||||
frontendOptions *options.App
|
||||
applicationMenu *menu.Menu
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user