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

Changed to activate before opening window on macos. #445

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

islandryu
Copy link

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

fix tauri-apps/tauri#4310

Fixed a bug that when starting tao with cargo run on macos, it was activated after the window was opened.

before fixed

1.mov

after fixed

2022-06-23.14.22.41.1.mov

@islandryu islandryu requested a review from a team as a code owner June 23, 2022 05:44
src/platform_impl/macos/app_state.rs Outdated Show resolved Hide resolved
src/platform_impl/macos/app_state.rs Show resolved Hide resolved
Copy link
Member

@keiya01 keiya01 left a comment

Choose a reason for hiding this comment

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

Thank you for your PR. Please check my review.

src/platform_impl/macos/app_delegate.rs Outdated Show resolved Hide resolved
@islandryu islandryu changed the title Changed to start before opening window on macos. Changed to activate before opening window on macos. Jun 23, 2022
Comment on lines 288 to 294
// In catalina, if we set the activation policy before the app is launched,
// We get a bug where the menu is not clickable.
// We have solved this problem by setting the activation policy to prohibited
// with `set_policy_to_prohibited` and then running `apply_activation_policy` again.
set_policy_to_prohibited();
apply_activation_policy(app_delegate);
Copy link
Author

Choose a reason for hiding this comment

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

@amrbashir @keiya01
I checked the operation in catalina and the menu bar was not clickable in the previous commit.
It is not a fundamental solution, but once I set the activation policy to prohibit and then run apply_activation_policy again, I can click on the menu bar.

output.compress-video-online.com.mp4

Copy link
Member

Choose a reason for hiding this comment

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

I will leave this for @wusyong to approve. He is the macOS expert.

Copy link
Member

@wusyong wusyong May 4, 2023

Choose a reason for hiding this comment

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

Sorry, I totally forgot this issue :(
I'm on Ventura now and this PR couldn't solve it.
Tested with winit and it also has this issue.
If anyone knows what's the latest way to fix it, please let us know.

@Hupka

This comment was marked as off-topic.

@stephenlrandall

This comment was marked as off-topic.

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 dev window incorrectly launching within full-screen editors
6 participants