Repository navigation
Conversation
6 tasks
Co-authored-by: Mitchell Cohen <[email protected]>
ckerr
force-pushed
the
trop/42-x-y-bp-fix-external-resize-hit-targets-for-frameless-windows-on-windows-1775776401817
branch
from
April 10, 2026 13:06
ab6aaca to
f1f8ec9
Compare
ckerr
approved these changes
Apr 10, 2026
ckerr
deleted the
trop/42-x-y-bp-fix-external-resize-hit-targets-for-frameless-windows-on-windows-1775776401817
branch
April 10, 2026 18:18
|
Release Notes Persisted
|
3 tasks done
5 tasks
t-bashir-bs
added a commit
to brightsign/electron
that referenced
this pull request
Jun 2, 2026
…play OS-21449 When creating a frameless BrowserWindow spanning multiple displays (e.g. 3840x1080 across dual HDMI), CenterWindow in the NativeWindowViews constructor clamps the size to the primary display's work area (1920x1080). InitFromOptions then called SetPosition(x, y), which only updated the position and preserved the clamped size, so the window was permanently stuck at 1920x1080. Fix: change InitFromOptions to call SetBounds with the full rect (position + original size from options) instead of SetPosition, restoring the intended dimensions after CenterWindow's clamping. This regression was introduced by upstream Electron commit 4affacb ("fix: external resize hit targets for frameless windows on Windows", PR electron#50864). That commit added a guard condition `if (!GetRestoredFrameBorderInsets().IsEmpty())` around a post-CenterWindow SetBounds call in the NativeWindowViews constructor, which previously ran unconditionally on Linux. For frameless windows (where frame border insets are zero), the SetBounds is now skipped, leaving CenterWindow's clamped size in effect. In Electron 28, the unconditional SetBounds after CenterWindow always restored the original requested size: // On linux after the widget is initialized we might have to force set the // bounds if the bounds are smaller than the current display SetBounds(gfx::Rect(GetPosition(), bounds.size()), false); This was preserved in commit 931c257 (PR electron#49209, "accurate window sizing and support for content sizing on Linux/Wayland with CSD"), which even documented the intent: "The widget clamps bounds to fit the screen, but we want to allow windows larger than the display." The subsequent commit 4affacb then inadvertently broke this for frameless windows.
t-bashir-bs
added a commit
to brightsign/electron
that referenced
this pull request
Jun 2, 2026
…play OS-21449 (#141) When creating a frameless BrowserWindow spanning multiple displays (e.g. 3840x1080 across dual HDMI), CenterWindow in the NativeWindowViews constructor clamps the size to the primary display's work area (1920x1080). InitFromOptions then called SetPosition(x, y), which only updated the position and preserved the clamped size, so the window was permanently stuck at 1920x1080. Fix: change InitFromOptions to call SetBounds with the full rect (position + original size from options) instead of SetPosition, restoring the intended dimensions after CenterWindow's clamping. This regression was introduced by upstream Electron commit 4affacb ("fix: external resize hit targets for frameless windows on Windows", PR electron#50864). That commit added a guard condition `if (!GetRestoredFrameBorderInsets().IsEmpty())` around a post-CenterWindow SetBounds call in the NativeWindowViews constructor, which previously ran unconditionally on Linux. For frameless windows (where frame border insets are zero), the SetBounds is now skipped, leaving CenterWindow's clamped size in effect. In Electron 28, the unconditional SetBounds after CenterWindow always restored the original requested size: // On linux after the widget is initialized we might have to force set the // bounds if the bounds are smaller than the current display SetBounds(gfx::Rect(GetPosition(), bounds.size()), false); This was preserved in commit 931c257 (PR electron#49209, "accurate window sizing and support for content sizing on Linux/Wayland with CSD"), which even documented the intent: "The widget clamps bounds to fit the screen, but we want to allow windows larger than the display." The subsequent commit 4affacb then inadvertently broke this for frameless windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #50706
See that PR for details.
Notes: Fixed resize hit targets for frameless windows on Windows. Resize targets now start at the side and bottom edges of the window and extend outward when
frame: false, matching the behavior for windows with frames.