Skip to content
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

Black out window triggers makeKeyWindow warning #4693

Closed
1 task done
low-batt opened this issue Nov 18, 2023 · 1 comment · Fixed by #4694
Closed
1 task done

Black out window triggers makeKeyWindow warning #4693

low-batt opened this issue Nov 18, 2023 · 1 comment · Fixed by #4694

Comments

@low-batt
Copy link
Contributor

System and IINA version:

  • macOS 13.6.1
  • IINA 1.3.3

Expected behavior:
When the IINA setting Black out other monitors while in full screen enabled no warnings are emitted.

Actual behavior:
When runing IINA under Xcode with setting Black out other monitors while in full screen enabled and using multiple monitors the following warning is seen the Xcode console after entering full screen mode:

Warning: -[NSWindow makeKeyWindow] called on NSWindow 0x7fe08908a850 which returned NO from -[NSWindow canBecomeKeyWindow].

Steps to reproduce:

  • Start IINA runing under Xcode

  • Click on Settings… under the IINA menu

  • The settings panel appears

  • In the Behavior section look for the Black out other monitors while in full screen setting

  • Enable that setting

  • Start playing a video

  • Click on the menu item Enter Full Screen under the Video menu

  • Look for the warning in the Xcode console

  • MPV does not have this problem.

How often does this happen?
Most of the time.

@low-batt low-batt added the bug label Nov 18, 2023
@low-batt low-batt self-assigned this Nov 18, 2023
low-batt added a commit that referenced this issue Nov 18, 2023
This commit will change the method blackOutOtherMonitors in the class
MainWindowController to call orderFront instead of makeKeyAndOrderFront.
@low-batt low-batt linked a pull request Nov 18, 2023 that will close this issue
2 tasks
@low-batt
Copy link
Contributor Author

Analysis

The warning is triggered by the following call to makeKeyAndOrderFront:

blackWindow.makeKeyAndOrderFront(nil)

From the documentation for canBecomeKey:

The value of this property is true if the window can become the key window, otherwise, false.

Attempts to make the window the key window are abandoned if the value of this property is false. The value of this property is true if the window has a title bar or a resize bar, or false otherwise.

The window used to black out a monitor does not meet these requirements and therefore can not become a key window. Debugging confirmed canBecomeKey is false for the black out window which explains why AppKit is emitting the warning.

Fixing

The commit in the pull request changes the method blackOutOtherMonitors in the class MainWindowController to call orderFront instead of makeKeyAndOrderFront.

svobs pushed a commit to svobs/iina-advance that referenced this issue Dec 4, 2023
This commit will change the method blackOutOtherMonitors in the class
MainWindowController to call orderFront instead of makeKeyAndOrderFront.
uiryuu pushed a commit that referenced this issue Jan 14, 2024
This commit will change the method blackOutOtherMonitors in the class
MainWindowController to call orderFront instead of makeKeyAndOrderFront.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant