Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR disables maximize and fullscreen modes on macOS to address issue #4290 due to unexpected behavior with macOS's support for these window states.
- Conditional window state handling based on operating system
- Removal of double-click to maximize functionality on macOS
- Disabling F11 fullscreen toggle on macOS
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| DecoratorSkin.java | Adds OS checks to disable window state listeners and double-click maximize on macOS |
| DecoratorController.java | Conditionally disables F11 fullscreen toggle on macOS |
| Controllers.java | Updates window state condition logic to exclude fullscreen/maximize checks on macOS |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| && !Controllers.stage.isMaximized()) { | ||
| // https://github.com/HMCL-dev/HMCL/issues/4290 | ||
| && (OperatingSystem.CURRENT_OS == OperatingSystem.MACOS || | ||
| !Controllers.stage.isFullScreen() && !Controllers.stage.isMaximized()) |
There was a problem hiding this comment.
The logical condition is confusing and could be simplified. Consider extracting this to a helper method or using clearer variable naming. The current logic (isMacOS || (!isFullScreen && !isMaximized)) would be clearer as separate conditions.
Suggested change
| !Controllers.stage.isFullScreen() && !Controllers.stage.isMaximized()) | |
| && shouldUpdateStageSize(Controllers.stage) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
macOS 对最大化/全屏模式的支持很奇怪。为了避免出现意外行为,我们暂时禁止在 macOS 上进入最大化和全屏模式。
本 PR 合并后我会尽快发布并推送新版本。