[V3/Linux] Fix Min/Max window options#3979
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request updates the changelog to reflect several new features, fixes, and changes across the Wails framework. Key additions include a method for opening the system file manager, new CLI commands, and enhancements to window management. The changes improve the handling of monitor resolutions and window sizing, particularly for Linux. Additionally, the build process has been refined, and various internal methods have been updated or deprecated, contributing to a more robust and flexible framework. Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
changelog.md
2e0c129 to
5fbba46
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
v3/pkg/application/webview_window_linux.go (1)
286-300: Ensure minimum size doesn't conflict with user-specified values.The logic sets a default minimum size of 1×1 if the user supplies 0. As a safeguard, validate if the user-supplied values are negative, which could cause unintended window sizing behavior.
v3/pkg/application/linux_cgo.go (1)
924-929: Provide more detailed logging for monitor fallback.When the current monitor is nil, fallback to the primary monitor is a good practice. Consider logging a warning if both the current and primary monitors are nil, to simplify troubleshooting.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docs/src/content/docs/changelog.mdx(1 hunks)v3/pkg/application/linux_cgo.go(1 hunks)v3/pkg/application/webview_window_linux.go(2 hunks)
🔇 Additional comments (2)
v3/pkg/application/webview_window_linux.go (1)
162-167: Consider making fallback resolution configurable.Falling back to 1920×1080 is a practical default, but consider providing a way to customize this fallback or query system defaults. Hardcoding a single fallback may lead to unexpected behavior on non-1080p systems.
Do you want me to propose an approach for making the fallback resolution configurable?
docs/src/content/docs/changelog.mdx (1)
42-42: PR reference looks good!Good job referencing PR #3979 for the min/max width fix. This is consistent with the user’s PR description and helps track the resolution context.
fix min/max options for linux changelog.md Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
There were a few reasons that were causing the
MinWidthMinHeightMaxWidthandMaxHeightoptions for the webview windows in linuxThe window geometry to allow for MaxWidth/Height to fill the entire monitor checks what screen the widget is on before it is rendered at the first start, Added a backup check for the primary monitor resolution to use as Max dimensions if no dimensions were found (otherwise max sizes were -1)
If for whatever reason the 2 doesnt return a monitor dimensions we default to 1920x1080 as a sane default. If this is an issue setting maximums in the options will override this default.
Summary by CodeRabbit
Release Notes
New Features
OpenFileManagermethod to open system file managerwails3 generate webview2bootstrapper,wails3 generate template,wails3 releasenotes,wails3 update cliinit()method for manual initializationImprovements
WindowDidMoveDebounceMSoption in Window settingsBug Fixes
Changes
WindowCloseevents toWindowClosingShouldCloseoption andWindow.Destroymethod