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

Merge pull request #4130 from oSethoum/v3-alpha-fix-window-events

[v3] fix: fullscreen, unfullscreen, unminise and unmaximise window events …
This commit is contained in:
Lea Anthony 2025-04-18 16:33:00 +10:00 committed by GitHub
commit edb90bdaab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -115,6 +115,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed initially-hidden menu items by [@IanVS](https://github.com/IanVS) in [#4116](https://github.com/wailsapp/wails/pull/4116)
- Fixed assetFileServer not serving `.html` files when non-extension request when `[request]` doesn't exist but `[request].html` does
- Fixed icon generation paths by [@robin-samuel](https://github.com/robin-samuel) in [#4125](https://github.com/wailsapp/wails/pull/4125)
- Fixed `fullscreen`, `unfullscreen`, `unminimise` and `unmaximise` events not being emitted by [@oSethoum](https://github.com/osethoum) in [#4130](https://github.com/wailsapp/wails/pull/4130)
- Fixed NSIS Error because of incorrect prefix on default version in config by [@robin-samuel](https://github.com/robin-samuel) in [#4126](https://github.com/wailsapp/wails/pull/4126)
- Fixed Dialogs runtime function returning escaped paths on Windows by [TheGB0077](https://github.com/TheGB0077) in [#4188](https://github.com/wailsapp/wails/pull/4188)
- Fixed Webview2 detection path in HKCU by [@leaanthony](https://github.com/leaanthony).

View File

@ -686,6 +686,7 @@ func (w *windowsWebviewWindow) maximise() {
func (w *windowsWebviewWindow) unmaximise() {
w.restore()
w.parent.emit(events.Windows.WindowUnMaximise)
}
func (w *windowsWebviewWindow) restore() {
@ -726,6 +727,7 @@ func (w *windowsWebviewWindow) fullscreen() {
int(monitorInfo.RcMonitor.Bottom-monitorInfo.RcMonitor.Top),
w32.SWP_NOOWNERZORDER|w32.SWP_FRAMECHANGED)
w.chromium.Focus()
w.parent.emit(events.Windows.WindowFullscreen)
}
func (w *windowsWebviewWindow) unfullscreen() {
@ -745,6 +747,7 @@ func (w *windowsWebviewWindow) unfullscreen() {
w32.SetWindowPos(w.hwnd, 0, 0, 0, 0, 0,
w32.SWP_NOMOVE|w32.SWP_NOSIZE|w32.SWP_NOZORDER|w32.SWP_NOOWNERZORDER|w32.SWP_FRAMECHANGED)
w.enableSizeConstraints()
w.parent.emit(events.Windows.WindowUnFullscreen)
}
func (w *windowsWebviewWindow) isMinimised() bool {
@ -1209,6 +1212,9 @@ func (w *windowsWebviewWindow) WndProc(msg uint32, wparam, lparam uintptr) uintp
case w32.SIZE_MAXIMIZED:
w.parent.emit(events.Windows.WindowMaximise)
case w32.SIZE_RESTORED:
if w.isMinimizing {
w.parent.emit(events.Windows.WindowUnMinimise)
}
w.isMinimizing = false
w.parent.emit(events.Windows.WindowRestore)
case w32.SIZE_MINIMIZED: