mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-06 18:40:59 +08:00
[v3 windows] Consolidate WM_SIZE/WM_SIZING message handling
This commit is contained in:
parent
b614e2b100
commit
f855b30c9f
@ -648,11 +648,6 @@ func (w *windowsWebviewWindow) WndProc(msg uint32, wparam, lparam uintptr) uintp
|
|||||||
if wparam == w32.WA_ACTIVE || wparam == w32.WA_CLICKACTIVE {
|
if wparam == w32.WA_ACTIVE || wparam == w32.WA_CLICKACTIVE {
|
||||||
getNativeApplication().currentWindowID = w.parent.id
|
getNativeApplication().currentWindowID = w.parent.id
|
||||||
}
|
}
|
||||||
case w32.WM_SIZE:
|
|
||||||
if w.chromium != nil {
|
|
||||||
w.chromium.Resize()
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
case w32.WM_CLOSE:
|
case w32.WM_CLOSE:
|
||||||
if w.parent.options.HideOnClose {
|
if w.parent.options.HideOnClose {
|
||||||
w.hide()
|
w.hide()
|
||||||
@ -666,17 +661,13 @@ func (w *windowsWebviewWindow) WndProc(msg uint32, wparam, lparam uintptr) uintp
|
|||||||
w32.SetFocus(w.hwnd)
|
w32.SetFocus(w.hwnd)
|
||||||
case w32.WM_MOVE, w32.WM_MOVING:
|
case w32.WM_MOVE, w32.WM_MOVING:
|
||||||
_ = w.chromium.NotifyParentWindowPositionChanged()
|
_ = w.chromium.NotifyParentWindowPositionChanged()
|
||||||
case w32.WM_SIZING:
|
case w32.WM_SIZE:
|
||||||
|
if w.parent.options.Frameless && wparam == w32.SIZE_MINIMIZED {
|
||||||
// If the window is frameless, and we are minimizing, then we need to suppress the Resize on the
|
// If the window is frameless, and we are minimizing, then we need to suppress the Resize on the
|
||||||
// WebView2. If we don't do this, restoring does not work as expected and first restores with some wrong
|
// WebView2. If we don't do this, restoring does not work as expected and first restores with some wrong
|
||||||
// size during the restore animation and only fully renders when the animation is done. This highly
|
// size during the restore animation and only fully renders when the animation is done. This highly
|
||||||
// depends on the content in the WebView, see https://github.com/wailsapp/wails/issues/1319
|
// depends on the content in the WebView, see https://github.com/wailsapp/wails/issues/1319
|
||||||
if w.parent.options.Frameless && wparam == w32.SIZE_MINIMIZED {
|
} else if w.resizeDebouncer != nil {
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we have a resize debouncer, use it
|
|
||||||
if w.resizeDebouncer != nil {
|
|
||||||
w.resizeDebouncer(func() {
|
w.resizeDebouncer(func() {
|
||||||
invokeSync(func() {
|
invokeSync(func() {
|
||||||
w.chromium.Resize()
|
w.chromium.Resize()
|
||||||
|
Loading…
Reference in New Issue
Block a user