-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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/Linux] Fix Min/Max window options #3979
base: v3-alpha
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request introduces several enhancements to the Wails framework, focusing on improving system integration, window management, and CLI functionality. Key additions include a new method for opening file managers, expanded CLI commands, and refinements to window handling across different platforms. The changes address various edge cases in monitor resolution and window sizing, particularly for Linux systems. The modifications aim to increase the robustness and flexibility of the framework's core functionality. Changes
Possibly related PRs
Suggested reviewers
Poem
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There were a few reasons that were causing the
MinWidth
MinHeight
MaxWidth
andMaxHeight
options 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
OpenFileManager
method to open system file managerwails3 generate webview2bootstrapper
,wails3 generate template
,wails3 releasenotes
,wails3 update cli
init()
method for manual initializationImprovements
WindowDidMoveDebounceMS
option in Window settingsBug Fixes
Changes
WindowClose
events toWindowClosing
ShouldClose
option andWindow.Destroy
method