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: event propagation after exiting fullscreen on Windows #33757

Merged
merged 1 commit into from Apr 14, 2022

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Apr 13, 2022

Description of Change

Closes #33721.

Fixes an issue where Escape keyboard events would not be properly propagated to the parent window after entering fullscreen and then exiting it again on Windows.

This was happening as a result of calling SetHtmlApiFullscreen(false) prior to calling exclusive_access_manager_->fullscreen_controller()->ExitFullscreenModeForTab(source). This created a race condition, wherein some platforms like macOS would work correctly becuase by the time !exclusive_access_context->IsFullscreen() was called, it wouldn't yet be true on macOS, and NotifyTabExclusiveAccessLost would relenquish its hold on keyboard event handling. However, on Windows, !exclusive_access_context->IsFullscreen() would be true, and thus the controller would continue to eat Escape key events. Fix this by adjusting the call order.

Tested with https://gist.github.com/bc382eeeb368b70fbed1e177bcaacfde on multiple platforms.

Checklist

Release Notes

Notes: Fixed an issue where Escape keyboard events would not be properly propagated to the parent window after entering fullscreen and then exiting it again on Windows.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/18-x-y labels Apr 13, 2022
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Apr 13, 2022
@nornagon
Copy link
Member

Notes say "on macOS", should they say "on Windows"?

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Apr 14, 2022
@codebytere codebytere merged commit 233a39d into main Apr 14, 2022
@codebytere codebytere deleted the fix-fullscreen-pointer-lock branch April 14, 2022 10:35
@release-clerk
Copy link

release-clerk bot commented Apr 14, 2022

Release Notes Persisted

Fixed an issue where Escape keyboard events would not be properly propagated to the parent window after entering fullscreen and then exiting it again on Windows.

@trop
Copy link
Contributor

trop bot commented Apr 14, 2022

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

@trop
Copy link
Contributor

trop bot commented Apr 14, 2022

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

bavulapati pushed a commit to bavulapati/electron that referenced this pull request Apr 29, 2022
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: After entering and exiting Fullscreen, pressing [Esc] no longer works
4 participants