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: check for draggable regions outside of main frame #41377

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

VerteDinde
Copy link
Member

@VerteDinde VerteDinde commented Feb 20, 2024

Description of Change

Fixes #41212

Fixes a bug introduced by crrev.com/c/4814003, where draggable regions on local frames (set using the app-region CSS property) are no longer automatically set and calculated unless an app uses a Window Controls Overlay or is Borderless. In the upstream CL, the change assumes that the local frame is a browser tab, and doesn't need draggable regions calculated; on Electron's side, we can't make that assumption.

This PR modifies the check to SetSupportsAppRegion() to also check for frames outside of the main frame.

Checklist

Release Notes

Notes: Fixed an issue where the -webkit-app-region: drag property was not respected on some windows.

@VerteDinde VerteDinde added semver/patch backwards-compatible bug fixes target/29-x-y PR should also be added to the "29-x-y" branch. labels Feb 20, 2024
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Feb 20, 2024
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Feb 21, 2024
@VerteDinde VerteDinde merged commit 136d7e7 into main Feb 21, 2024
27 checks passed
@VerteDinde VerteDinde deleted the drag-webkit-region-fix branch February 21, 2024 03:10
Copy link

release-clerk bot commented Feb 21, 2024

Release Notes Persisted

Fixed an issue where the -webkit-app-region: drag property was not respected on some windows.

@trop
Copy link
Contributor

trop bot commented Feb 21, 2024

I was unable to backport this PR to "29-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot added needs-manual-bp/29-x-y and removed target/29-x-y PR should also be added to the "29-x-y" branch. labels Feb 21, 2024
@trop
Copy link
Contributor

trop bot commented Feb 21, 2024

@VerteDinde has manually backported this PR to "29-x-y", please check out #41388

// In Chrome, app regions are only supported in the main frame.
// However, we need to support draggable regions on other
// local frames/windows, so extend support beyond the main frame.
render_frame_->GetWebView()->SetSupportsAppRegion(true);
Copy link
Member

Choose a reason for hiding this comment

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

Reason for excluding child frames was devtools inspect gets broken, refs https://electronhq.slack.com/archives/CB6CG54DB/p1705578798763399?thread_ts=1705578659.730389&cid=CB6CG54DB. Please check if inspect continues to work with this change.

/cc @marekharanczyk

@trop trop bot added merged/29-x-y PR was merged to the "29-x-y" branch. and removed in-flight/29-x-y labels Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/29-x-y PR was merged to the "29-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: -webkit-app-region: drag still doesn't works after #41030
4 participants