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: preserve macos child window level #44155

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JoelEinbinder
Copy link

Description of Change

There is some code in Chromium that checks the window level to determine if an unfocused window can receive mousemove events.

When Electron sets a window's parent, the level of both the parent and child are reset to NSWindowNormal. There is already some code to restore the parent's level. So I added some code to restore the child's level as well.

If the current behavior is the intended behavior, then an alternative patch could add a new window property that overrides the level check in Chromium. But this seemed simpler to me.

I couldn't find any tests for this area of the code. Happy to let someone with more Electron knowledge take over from here if much more is needed to get this landed.

Fixes #44150

Release Notes

Notes: Fixed MacOS windows losing their alwaysOnTop status when they were assigned a parent window.

Copy link

welcome bot commented Oct 9, 2024

💖 Thanks for opening this pull request! 💖

Semantic PR titles

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

Commit signing

This repo enforces commit signatures for all incoming PRs.
To sign your commits, see GitHub's documentation on Telling Git about your signing key.

PR tips

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 Oct 9, 2024
@codebytere codebytere self-requested a review October 10, 2024 08:27
@codebytere codebytere added the semver/patch backwards-compatible bug fixes label Oct 10, 2024
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Oct 10, 2024
@codebytere codebytere added new-pr 🌱 PR opened in the last 24 hours target/31-x-y PR should also be added to the "31-x-y" branch. target/32-x-y PR should also be added to the "32-x-y" branch. target/33-x-y PR should also be added to the "33-x-y" branch. labels Oct 10, 2024
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Oct 10, 2024
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.

@JoelEinbinder could you try to add a test for this? Beyond that LGTM!

@JoelEinbinder
Copy link
Author

@JoelEinbinder could you try to add a test for this? Beyond that LGTM!

I can write a test except I don't know where a test for this would live. I tried to look for examples but there was no test in the previous patches that restored the parents level (af4cf1e) and the one that added panels (21ef850).

@codebytere
Copy link
Member

@joel I'd say this should live in browser-window spec - you can just add a new describe. Also, can you please sign your commit?

@github-actions github-actions bot added the target/34-x-y PR should also be added to the "34-x-y" branch. label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes target/31-x-y PR should also be added to the "31-x-y" branch. target/32-x-y PR should also be added to the "32-x-y" branch. target/33-x-y PR should also be added to the "33-x-y" branch. target/34-x-y PR should also be added to the "34-x-y" branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Unfocusable panel does not respond to hover if it has a parent
2 participants