Skip to content

[v3] Fix WindowUnMinised event not fired when the window was Maxmised on Windows platform. - #4478

Merged
leaanthony merged 3 commits into
wailsapp:v3-alphafrom
oSethoum:v3-alpha
Aug 6, 2025
Merged

leaanthony merged 3 commits into
wailsapp:v3-alphafrom
oSethoum:v3-alpha

Conversation

@oSethoum

@oSethoum oSethoum commented Aug 6, 2025 •

Copy link
Copy Markdown
Contributor

Description

WindowUnMinised event not fired when the window was Maxmised it only fires if the Window state was Normal.

Type of change

Please select the option that is relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • Windows
  • macOS
  • Linux

If you checked Linux, please specify the distro and version.

Test Configuration

Please paste the output of wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.

 Wails (v3.0.0-alpha.19)  Wails Doctor

# System

┌───────────────────────────────────────────────────────────────────────────────────────────────┐
| Name              | Windows 10 Pro                                                            |
| Version           | 2009 (Build: 26100)                                                       |
| ID                | 24H2                                                                      |
| Branding          | Windows 11 Pro                                                            |
| Platform          | windows                                                                   |
| Architecture      | amd64                                                                     |
| Go WebView2Loader | true                                                                      |
| WebView2 Version  | 138.0.3351.121                                                            |
| CPU               | 13th Gen Intel(R) Core(TM) i7-1360P                                       |
| GPU 1             | NVIDIA GeForce RTX 3050 4GB Laptop GPU (NVIDIA) - Driver: 31.0.15.3713    |
| GPU 2             | Intel(R) Iris(R) Xe Graphics (Intel Corporation) - Driver: 31.0.101.3688  |
| Memory            | 32GB                                                                      |
└───────────────────────────────────────────────────────────────────────────────────────────────┘

# Build Environment

┌────────────────────────────────┐
| Wails CLI    | v3.0.0-alpha.19 |
| Go Version   | go1.24.5        |
| -buildmode   | exe             |
| -compiler    | gc              |
| CGO_CFLAGS   |                 |
| CGO_CPPFLAGS |                 |
| CGO_CXXFLAGS |                 |
| CGO_ENABLED  | 1               |
| CGO_LDFLAGS  |                 |
| GOAMD64      | v1              |
| GOARCH       | amd64           |
| GOOS         | windows         |
└────────────────────────────────┘

# Dependencies

┌────────────────────────────────────────────┐
| SignTool.exe (Windows SDK) | Not Installed |
| npm                        |               |
| NSIS                       | v3.11         |
| MakeAppx.exe (Windows SDK) | Not Installed |
| MSIX Packaging Tool        | Not Installed |
|                                            |
└───────── * - Optional Dependency ──────────┘

# Checking for issues

 SUCCESS  No issues found

# Diagnosis

 WARNING  There are some items above that need addressing!

Need documentation? Run: wails3 docs
 ♥   If Wails is useful to you or your company, please consider sponsoring the project: wails3 sponsor

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Bug Fixes
    • Resolved an issue on Windows where the WindowUnMinimise event was not triggered when restoring a window from a maximized state after minimizing.

@coderabbitai

coderabbitai Bot commented Aug 6, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

A bug fix was implemented for Windows window event handling: when a window is maximized after being minimized, the WindowUnMinimise event is now correctly emitted. The change updates the WM_SIZE message handler and is documented in the unreleased changelog.

Changes

Cohort / File(s) Change Summary
Changelog Update
v3/UNRELEASED_CHANGELOG.md
Added a bug fix entry describing the correct firing of WindowUnMinimise after maximize on Windows.
Windows Event Handling
v3/pkg/application/webview_window_windows.go
Modified WM_SIZE handler to emit WindowUnMinimise if the window was minimized before maximizing.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant WindowProc
    participant EventEmitter

    User->>WindowProc: Maximize window (after minimized)
    WindowProc->>WindowProc: Detect WM_SIZE, SIZE_MAXIMIZED
    alt isMinimizing == true
        WindowProc->>EventEmitter: Emit WindowUnMinimise
        WindowProc->>WindowProc: isMinimizing = false
    end
    WindowProc->>EventEmitter: Emit WindowMaximise
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

lgtm

Poem

A window once minimized, quiet and small,
Now springs to life, no bug to befall!
With events in order, and logic anew,
The maximize dance is perfectly true.
🐇✨ Bugs be gone, let the windows shine—
This patch makes everything align!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d44997 and 57233dc.

📒 Files selected for processing (1)
  • v3/UNRELEASED_CHANGELOG.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • v3/UNRELEASED_CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
  • GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
  • GitHub Check: Run Go Tests v3 (macos-latest, 1.24)
  • GitHub Check: semgrep-cloud-platform/scan
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 6, 2025
@github-actions github-actions Bot added Documentation Improvements or additions to documentation Windows v3-alpha labels Aug 6, 2025
@dosubot dosubot Bot added Bug Something isn't working v3 labels Aug 6, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69929c2 and 9d44997.

📒 Files selected for processing (2)
  • v3/UNRELEASED_CHANGELOG.md (1 hunks)
  • v3/pkg/application/webview_window_windows.go (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: in the codebase, `application.options.keybindings` uses the `application.window` type, whereas `appl...
Learnt from: nixpare
PR: wailsapp/wails#3763
File: v3/examples/keybindings/main.go:16-17
Timestamp: 2024-09-20T23:34:29.841Z
Learning: In the codebase, `application.Options.KeyBindings` uses the `application.Window` type, whereas `application.WebviewWindowOptions.KeyBindings` uses `*application.WebviewWindow`. This is intentional and acceptable.

Applied to files:

  • v3/pkg/application/webview_window_windows.go
📚 Learning: in `v3/examples/window/main.go`, `time.sleep` is used within a goroutine and does not block the ui t...
Learnt from: leaanthony
PR: wailsapp/wails#3763
File: v3/examples/window/main.go:472-475
Timestamp: 2024-09-30T06:13:46.595Z
Learning: In `v3/examples/window/main.go`, `time.Sleep` is used within a goroutine and does not block the UI thread.

Applied to files:

  • v3/pkg/application/webview_window_windows.go
📚 Learning: the `keybindings` property of `application.option` uses the `application.window` type, while `applic...
Learnt from: nixpare
PR: wailsapp/wails#3763
File: v3/pkg/application/application_options.go:93-93
Timestamp: 2024-10-08T22:11:37.054Z
Learning: The `KeyBindings` property of `application.Option` uses the `application.Window` type, while `application.WebviewWindowOptions` still accepts `*application.WebviewWindow`, and this is intentional.

Applied to files:

  • v3/pkg/application/webview_window_windows.go
🧬 Code Graph Analysis (1)
v3/pkg/application/webview_window_windows.go (2)
v3/pkg/events/events.go (1)
  • Windows (370-370)
v3/pkg/application/messageprocessor_window.go (1)
  • WindowUnMinimise (55-55)
🪛 LanguageTool
v3/UNRELEASED_CHANGELOG.md

[grammar] ~51-~51: Ensure spelling is correct
Context: ...ntext menus on Linux with Wayland - Fix WindowUnMinised event not fired when the window was Max...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~51-~51: Ensure spelling is correct
Context: ...sed event not fired when the window was Maxmised on Windows. Security: - Update dep...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
  • GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
  • GitHub Check: Run Go Tests v3 (macos-latest, 1.24)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
v3/pkg/application/webview_window_windows.go (1)

1488-1491: LGTM! Clean bug fix implementation.

The fix correctly ensures that WindowUnMinimise event is emitted when transitioning from minimized to maximized state. This mirrors the existing logic in the SIZE_RESTORED case and maintains proper event sequencing.

Comment thread v3/UNRELEASED_CHANGELOG.md Resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2025

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
E Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 6, 2025
@leaanthony
leaanthony merged commit 26a18ef into wailsapp:v3-alpha Aug 6, 2025
@leaanthony

Copy link
Copy Markdown
Member

Thanks @oSethoum 🙏

Grantmartin2002 pushed a commit to Grantmartin2002/wails that referenced this pull request Apr 29, 2026
… on Windows platform. (wailsapp#4478)

* fix: v3-alpha WindowUnMinimise not fired when window is maximized ( Windows )

* add fix to changelog.mdx

* Apply suggestion from @coderabbitai[bot]

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Lea Anthony <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files. v3 Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants