mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 17:22:01 +08:00
Suppress resizing during minimize of a frameless window (#1322)
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 size during the restore animation and only fully renders when the animation is done. This highly depends on the content in the WebView. Possible fix for #1319
This commit is contained in:
parent
5f596c7679
commit
c70d93b482
@ -143,6 +143,17 @@ func (f *Frontend) Run(ctx context.Context) error {
|
||||
f.mainWindow.notifyParentWindowPositionChanged = f.chromium.NotifyParentWindowPositionChanged
|
||||
|
||||
mainWindow.OnSize().Bind(func(arg *winc.Event) {
|
||||
if f.frontendOptions.Frameless {
|
||||
// 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
|
||||
// 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
|
||||
event, _ := arg.Data.(*winc.SizeEventData)
|
||||
if event != nil && event.Type == w32.SIZE_MINIMIZED {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
f.chromium.Resize()
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user