Skip to content

Fix #4290: 在 macOS 上禁止最大化和全屏模式#4293

Merged
Glavo merged 1 commit intoHMCL-dev:mainfrom
Glavo:mac-drag
Aug 20, 2025
Merged

Fix #4290: 在 macOS 上禁止最大化和全屏模式#4293
Glavo merged 1 commit intoHMCL-dev:mainfrom
Glavo:mac-drag

Conversation

@Glavo
Copy link
Copy Markdown
Member

@Glavo Glavo commented Aug 19, 2025

macOS 对最大化/全屏模式的支持很奇怪。为了避免出现意外行为,我们暂时禁止在 macOS 上进入最大化和全屏模式。

本 PR 合并后我会尽快发布并推送新版本。

@Glavo Glavo requested a review from Copilot August 19, 2025 15:25
@Glavo Glavo linked an issue Aug 19, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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())
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

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)

Copilot uses AI. Check for mistakes.
@HMCL-dev HMCL-dev deleted a comment from Copilot AI Aug 19, 2025
@Glavo Glavo merged commit 0e12c1a into HMCL-dev:main Aug 20, 2025
2 checks passed
@Glavo Glavo deleted the mac-drag branch August 20, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] MacOS 3.6.15 -> 3.6.15.290 窗口无法正常拖动

2 participants