Skip to content

fix: BrowserWindow.isFocused() on Windows #47780

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

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

Conversation

codebytere
Copy link
Member

Description of Change

Closes #47749

Fixes an issue where BrowserWindow.isFocused incorrectly returned true even if the window was not in the foreground. To fix this, we should check GetForegroundWindow() on Windows as well as whether or not the widget is active.

Checklist

Release Notes

Notes: Fixed an issue where BrowserWindow.isFocused incorrectly returned true even if the window was not in the foreground.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/36-x-y PR should also be added to the "36-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. labels Jul 16, 2025
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jul 16, 2025
@deepak1556
Copy link
Member

Failing test on windows are related

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jul 17, 2025
@codebytere codebytere force-pushed the fix-isfocused-foreground branch from 1df5b98 to 64946f9 Compare July 21, 2025 17:29
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/36-x-y PR should also be added to the "36-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows: win.focus() results in win.isFocused() to return true even if not
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy