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: take foreground visibility into account for win.isVisible() on macOS #17463

Merged
merged 1 commit into from Mar 20, 2019

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Mar 19, 2019

Description of Change

Resolves #16776.

Right now, our documentation says that for isVisible to return true for a given BrowserWindow, it must be "visible to the user." As @nickfujita pointed out, this should take into account whether or not a window is minimized, as well as whether or not a window is in the foreground (i.e. not obscured by other apps).

This PR therefore updates our win.isVisible() implementation on macOS to take occlusion and minimization into explicit account.

cc @MarshallOfSound

Checklist

Release Notes

Notes: Fixed an issue whereby foreground visibility of a window was not correctly taken into account for win.isVisible() on macOS

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Mar 19, 2019
@codebytere codebytere changed the title fix: take foreground visibility into account for isVisible on macOS fix: take foreground visibility into account for win.isVisible() on macOS Mar 19, 2019
Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

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

Worth noting that the standard API [document.visibilityState](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState handles occlusions correctly and the current impl on Windows/Linux also uses the TrackOcclusionState helper for widgets in Chromium.

Strong 👍 on this change

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Mar 20, 2019
@codebytere codebytere merged commit b140a82 into master Mar 20, 2019
@release-clerk
Copy link

release-clerk bot commented Mar 20, 2019

Release Notes Persisted

Fixed an issue whereby foreground visibility of a window was not correctly taken into account for win.isVisible() on macOS

@trop
Copy link
Contributor

trop bot commented Mar 20, 2019

I have automatically backported this PR to "5-0-x", please check out #17491

@trop
Copy link
Contributor

trop bot commented Mar 20, 2019

I have automatically backported this PR to "4-1-x", please check out #17492

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
5.0.x
Fixed in 5.0.0-beta.7
Development

Successfully merging this pull request may close these issues.

None yet

2 participants