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

fix: add missing set_wants_to_be_visible(true) to NativeWindowMac::ShowInactive() #40546

Merged
merged 2 commits into from Nov 30, 2023

Conversation

tzahola
Copy link
Contributor

@tzahola tzahola commented Nov 16, 2023

Description of Change

PR #40062 introduced a bool wants_to_be_visible_ flag to NativeWindowMac, but it wasn't set in NativeWindowMac::ShowInactive(), only in NativeWindowMac::Show(). This meant that the parent-child relationship wouldn't be established for any window that was opened while the app wasn't the active one (typically this can occur in apps with always-visible floating overlay windows).

CC @codebytere

Checklist

Release Notes

Notes: fixed child window opening in non-active macOS apps

Copy link

welcome bot commented Nov 16, 2023

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Nov 16, 2023
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

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

@tzahola would you be willing to add a test for this?

@codebytere codebytere changed the title fix: add missing set_wants_to_be_visible(true) to NativeWindowMac::ShowInactive() fix: add missing set_wants_to_be_visible(true) to NativeWindowMac::ShowInactive() Nov 17, 2023
@tzahola
Copy link
Contributor Author

tzahola commented Nov 17, 2023

@tzahola would you be willing to add a test for this?

I'll try!

@tzahola
Copy link
Contributor Author

tzahola commented Nov 20, 2023

@tzahola would you be willing to add a test for this?

I'm afraid I can't really do this, because I can't even run the tests on the current main, due to third_party/electron_node:headers being a non-existent target:

$ ninja -C out/Testing third_party/electron_node:headers
ninja: Entering directory `out/Testing'
ninja: error: unknown target 'third_party/electron_node:headers'

Which then causes npm run test to fail with:

gyp: /.../electron/src/out/Testing/gen/node_headers/common.gypi not found (cwd: /.../electron/src/electron/spec/node_modules/@electron-ci/uv-dlopen) while reading includes of binding.gyp while trying to load binding.gyp

Any idea why this is the case?

@tzahola
Copy link
Contributor Author

tzahola commented Nov 20, 2023

Ok, it seems that in bfa58df the Node headers target was moved from third_party/node_electron:headers to electron:node_headers, but this wasn't updated in the docs.

@codebytere
Copy link
Member

@tzahola are you using https://github.com/electron/build-tools? it makes everything much easier.

@tzahola
Copy link
Contributor Author

tzahola commented Nov 22, 2023

@codebytere added test: cf73ec9

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Nov 23, 2023
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

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

Thanks!

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/26-x-y PR should also be added to the "26-x-y" branch. target/27-x-y PR should also be added to the "27-x-y" branch. target/28-x-y PR should also be added to the "28-x-y" branch. labels Nov 29, 2023
@codebytere codebytere merged commit 39ee940 into electron:main Nov 30, 2023
24 of 25 checks passed
Copy link

welcome bot commented Nov 30, 2023

Congrats on merging your first pull request! 🎉🎉🎉

Copy link

release-clerk bot commented Nov 30, 2023

Release Notes Persisted

fixed child window opening in non-active macOS apps

@trop
Copy link
Contributor

trop bot commented Nov 30, 2023

I have automatically backported this PR to "26-x-y", please check out #40657

@trop trop bot removed the target/26-x-y PR should also be added to the "26-x-y" branch. label Nov 30, 2023
@trop
Copy link
Contributor

trop bot commented Nov 30, 2023

I have automatically backported this PR to "27-x-y", please check out #40658

@trop
Copy link
Contributor

trop bot commented Nov 30, 2023

I have automatically backported this PR to "28-x-y", please check out #40659

@trop trop bot added in-flight/28-x-y merged/26-x-y PR was merged to the "26-x-y" branch. merged/28-x-y PR was merged to the "28-x-y" branch. and removed target/27-x-y PR should also be added to the "27-x-y" branch. target/28-x-y PR should also be added to the "28-x-y" branch. in-flight/26-x-y in-flight/28-x-y labels Nov 30, 2023
@trop trop bot added merged/27-x-y PR was merged to the "27-x-y" branch. and removed in-flight/27-x-y labels Dec 8, 2023
MrHuangJser pushed a commit to MrHuangJser/electron that referenced this pull request Dec 11, 2023
…:ShowInactive()` (electron#40546)

* fix: add missing set_wants_to_be_visible(true) to NativeWindowMac::ShowInactive()

* add test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/26-x-y PR was merged to the "26-x-y" branch. merged/27-x-y PR was merged to the "27-x-y" branch. merged/28-x-y PR was merged to the "28-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants