Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion shell/browser/native_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,15 @@ void NativeWindow::InitFromOptions(const gin_helper::Dictionary& options) {
}

if (int x, y; options.Get(options::kX, &x) && options.Get(options::kY, &y)) {
SetPosition(gfx::Point{x, y});
// BrightSign: Use SetBounds with the full rect (including width/height
// from options) instead of just SetPosition. CenterWindow in the
// NativeWindowViews constructor clamps the window size to the primary
// display's work area, which breaks windows spanning multiple displays
// (e.g. dual HDMI at 3840x1080). SetPosition only restores the origin
// and preserves the clamped size, so we must restore the full bounds.
const int w = options.ValueOrDefault(options::kWidth, GetSize().width());
const int h = options.ValueOrDefault(options::kHeight, GetSize().height());
SetBounds(gfx::Rect(x, y, w, h), false);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can this be upstreamed?


#if BUILDFLAG(IS_WIN)
// FIXME(felixrieseberg): Dirty, dirty workaround for
Expand Down
Loading