Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] fix: fullscreen, unfullscreen, unminise and unmaximise window events … #4130

Open
wants to merge 2 commits into
base: v3-alpha
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/content/docs/changelog.mdx
Original file line number Diff line number Diff line change
@@ -109,6 +109,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed [#4097](https://github.com/wailsapp/wails/issues/4097) Webpack/angular discards runtime init code by [@fbbdev](https://github.com/fbbdev) in [#4100](https://github.com/wailsapp/wails/pull/4100)
- 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)

### Changed

6 changes: 6 additions & 0 deletions v3/pkg/application/webview_window_windows.go
Original file line number Diff line number Diff line change
@@ -679,6 +679,7 @@ func (w *windowsWebviewWindow) maximise() {

func (w *windowsWebviewWindow) unmaximise() {
w.restore()
w.parent.emit(events.Windows.WindowUnMaximise)
}

func (w *windowsWebviewWindow) restore() {
@@ -719,6 +720,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() {
@@ -738,6 +740,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 {
@@ -1202,6 +1205,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: