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: toggling DevTools while minimized on Windows #40091

Merged
merged 1 commit into from Oct 6, 2023

Conversation

codebytere
Copy link
Member

Description of Change

Closes #39991.

Fixes an issue where if a user opened DevTools in detached mode, minimized the DevTools window, and then toggled DevTools off and on again, the window would no longer be visible to the user. This was happening because our existing logic saved the last known DevTools window bounds prior to closure, and then attempted to restore to those bounds if the DevTools window was re-opened. However, if the window was minimized prior to being toggled off, then the saved bounds would be wildly inaccurate as a result of our calling GetWindowBoundsInScreen():

 InspectableWebContents::SaveDevToolsBounds(): -16000,-16000 157x25

This fixes that by using the normal bounds if the window is not currently on screen.

Tested with https://gist.github.com/c985de2d95ffedb47bc966edaf3bfe8c

Checklist

Release Notes

Notes: Fixes an issue where closing and opening a minimized DevTools window would not work as expected.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/25-x-y PR should also be added to the "25-x-y" branch. target/26-x-y PR should also be added to the "26-x-y" branch. target/27-x-y PR should also be added to the "27-x-y" branch. labels Oct 4, 2023
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Oct 4, 2023
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Oct 5, 2023
@jkleinsc jkleinsc merged commit 7355303 into main Oct 6, 2023
23 checks passed
@jkleinsc jkleinsc deleted the fix-toggle-devtools-while-minimized branch October 6, 2023 00:26
@release-clerk
Copy link

release-clerk bot commented Oct 6, 2023

Release Notes Persisted

Fixes an issue where closing and opening a minimized DevTools window would not work as expected.

@trop
Copy link
Contributor

trop bot commented Oct 6, 2023

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

@trop trop bot added the in-flight/27-x-y label Oct 6, 2023
@trop trop bot removed the target/27-x-y PR should also be added to the "27-x-y" branch. label Oct 6, 2023
@trop
Copy link
Contributor

trop bot commented Oct 6, 2023

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

@trop
Copy link
Contributor

trop bot commented Oct 6, 2023

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

@trop trop bot added in-flight/25-x-y in-flight/26-x-y merged/25-x-y PR was merged to the "25-x-y" branch. and removed target/25-x-y PR should also be added to the "25-x-y" branch. target/26-x-y PR should also be added to the "26-x-y" branch. in-flight/25-x-y labels Oct 6, 2023
@trop trop bot added merged/26-x-y PR was merged to the "26-x-y" branch. merged/27-x-y PR was merged to the "27-x-y" branch. and removed in-flight/26-x-y in-flight/27-x-y labels Oct 6, 2023
MrHuangJser pushed a commit to MrHuangJser/electron that referenced this pull request Dec 11, 2023
fix: toggling devtools while minimized on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/25-x-y PR was merged to the "25-x-y" branch. merged/26-x-y PR was merged to the "26-x-y" branch. merged/27-x-y PR was merged to the "27-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: After minimizing the devtool window and opening it again, the devtool window cannot be found
4 participants