cucbin

#48770: fix: the parent window remained interactive after the modal window was opened

Merged
Created: Nov 4, 2025, 12:59:02 AM
Merged: Nov 10, 2025, 5:06:29 AM
5 comments
Target: main

Description of Change

Closes #48535

If calling maximize() before show() while open a modal window, maximize() would calling Show() of native_widget_private().

widget()->native_widget_private()->Show(
ui::mojom::WindowShowState::kMaximized, gfx::Rect());

When using API to call show() to show the modal window, it will cause the conditional result as false,

if (is_modal() && NativeWindow::parent() && !widget()->IsVisible())
static_cast<NativeWindowViews*>(parent())->IncrementChildModals();

So cause the parent window remained interactive after the modal window was opened.

Search commit history, the code introduced in PR: #8768, I cannot reproduce the issues(#8768 and #8677) that PR fixed originally.

While I personally don't recommend resizing the modal window, including minimize and maximize. the API cannot prevent users from maximize before the showing.

Checklist

Release Notes

Notes: Fixed the issue where the parent window remained interactive after the modal window was opened.

Backports

38-x-y
Merged
PR Number
#48866
Merged At
Nov 13, 2025, 9:08:30 AM
Released In
v38.7.0
Release Date
Nov 13, 2025, 8:31:35 PM
39-x-y
Merged
PR Number
#48865
Merged At
Nov 10, 2025, 6:55:25 AM
Released In
v39.1.2
Release Date
Nov 10, 2025, 2:06:59 PM
40-x-y
Merged
PR Number
#48864
Merged At
Nov 10, 2025, 6:55:47 AM
Released In
v40.0.0-alpha.5
Release Date
Nov 14, 2025, 2:22:11 PM

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron