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: make BrowserWindow#isFocused() return false when blur() is called on macOS #34029

Conversation

trop[bot]
Copy link
Contributor

@trop trop bot commented May 3, 2022

Backport of #33734

See that PR for details.

Notes: Fixed an issue where BrowserWindow#isFocused() was returning false when blur() was called on macOS.

…d on macOS

The isFocused() method on macOS works by checking if the selected
BrowserWindow is a key window. Unfortunately, this didn't work well
with blur() because it wasn't calling any macOS APIs that would change
the key status of the window. Hence, this changes the implementation of
blur() to call orderOut first, which removes the key
status of the window. Then when the orderBack function is called, it
moves the window to the back of its level in the screen list, without
changing the key window.

Fixes: #33732
Signed-off-by: Darshan Sen <raisinten@gmail.com>
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label May 3, 2022
@trop trop bot added 17-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels May 3, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label May 3, 2022
@MarshallOfSound MarshallOfSound merged commit da40d1e into 17-x-y May 4, 2022
@MarshallOfSound MarshallOfSound deleted the trop/17-x-y-bp-fix-make-browserwindow-isfocused-return-false-when-blur-is-called-on-macos-1651563586971 branch May 4, 2022 07:05
@release-clerk
Copy link

release-clerk bot commented May 4, 2022

Release Notes Persisted

Fixed an issue where BrowserWindow#isFocused() was returning false when blur() was called on macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
17-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants