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: menus on Linux after window modification #37798

Merged
merged 2 commits into from Apr 11, 2023

Conversation

dsanders11
Copy link
Member

@dsanders11 dsanders11 commented Apr 3, 2023

Description of Change

Fixes #35724.

More details on that issue, but long and short of it is Chromium made a performance improvement change to the X11 window cache and that caused a bug with menus on Linux in Electron since v19.0.0-alpha.4. Seems safe to revert since it only aimed to improve performance and had no other functional changes. Upstream bug opened so they can properly fix it.

I don't love the test since it has arbitrary waits, but it's a tricky issue to test. You can confirm the added test fails on the latest nightly by using e test --runners=main --electronVersion=25.0.0-nightly.20230331 -g "does not trigger issue #35724$".

Checklist

Release Notes

Notes: Fixed an issue on Linux where menus would not open after resizing/maximizing/unmaximizing a window

@dsanders11 dsanders11 requested a review from a team as a code owner April 3, 2023 03:54
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Apr 3, 2023
@codebytere codebytere self-requested a review April 3, 2023 10:39
@dsanders11
Copy link
Member Author

Updated to disable the test on CI, unfortunately. While SSH'd in to test workarounds for 'maximize' not firing for Linux, tested with --electronVersion and found that the test unexpectedly passed on v25.0.0-nightly.20230331 despite failing locally. Another casualty of headless Linux CI.

@dsanders11 dsanders11 added target/22-x-y PR should also be added to the "22-x-y" branch. target/23-x-y PR should also be added to the "23-x-y" branch. target/24-x-y PR should also be added to the "24-x-y" branch. semver/patch backwards-compatible bug fixes labels Apr 3, 2023
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Apr 4, 2023
Window WindowCache::GetWindowAtPoint(gfx::Point point_px,
Window window,
const base::flat_set<Window>* ignore) {
- delete_when_destroy_timer_fires_ = true;
Copy link
Member

Choose a reason for hiding this comment

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

It seems that removing this line alone should be enough to fix the issue?

I'm good with a large patch reverting the commit, I'm just a bit worried it would take too much time for Chromium to fix the issue and this patch will become a burden on us.

Copy link
Member Author

@dsanders11 dsanders11 Apr 6, 2023

Choose a reason for hiding this comment

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

That's a good concern to call out.

It looks like they've fixed it pretty quickly upstream (although I haven't tested it in Electron): https://chromium-review.googlesource.com/c/chromium/src/+/4401194

So this fix could be changed to backport that upstream fix rather than doing a revert, although I think more rigorous testing should be done for that.

I think there might be more risk in backporting the upstream fix since it is a more general change which may be making assumptions/rely on other changes which have been made in upstream - I'd be concerned it might cause other subtle bugs by backporting it too far back. The revert in this PR is self-contained (AFAIK).

So I guess I'd say now that it's been fixed upstream, we can land this revert without too much burden on us, and we'll pick up the upstream fix in Electron v26.

@jkleinsc jkleinsc added the target/25-x-y PR should also be added to the "25-x-y" branch. label Apr 6, 2023
@zcbenz zcbenz merged commit 3c0c4d5 into electron:main Apr 11, 2023
14 checks passed
@release-clerk
Copy link

release-clerk bot commented Apr 11, 2023

Release Notes Persisted

Fixed an issue on Linux where menus would not open after resizing/maximizing/unmaximizing a window

@trop
Copy link
Contributor

trop bot commented Apr 11, 2023

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

@trop trop bot added in-flight/25-x-y and removed target/25-x-y PR should also be added to the "25-x-y" branch. labels Apr 11, 2023
@trop
Copy link
Contributor

trop bot commented Apr 11, 2023

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

@trop
Copy link
Contributor

trop bot commented Apr 11, 2023

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

@trop
Copy link
Contributor

trop bot commented Apr 11, 2023

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

@trop trop bot added in-flight/22-x-y and removed target/24-x-y PR should also be added to the "24-x-y" branch. target/22-x-y PR should also be added to the "22-x-y" branch. labels Apr 11, 2023
@trop trop bot added merged/25-x-y PR was merged to the "25-x-y" branch. and removed target/23-x-y PR should also be added to the "23-x-y" branch. in-flight/22-x-y in-flight/25-x-y labels Apr 11, 2023
@dsanders11 dsanders11 deleted the fix-35724 branch April 11, 2023 22:26
@trop trop bot added merged/24-x-y PR was merged to the "24-x-y" branch merged/23-x-y PR was merged to the "23-x-y" branch. and removed in-flight/24-x-y labels Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/23-x-y PR was merged to the "23-x-y" branch. merged/24-x-y PR was merged to the "24-x-y" branch merged/25-x-y PR was merged to the "25-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: After resize the window manually, clicking the menu does not show submenus
3 participants