mirror of
https://github.com/electron/electron.git
synced 2026-01-10 07:58:08 -05:00
fix: the parent window remained interactive after the modal window was opened (#48770)
fix: fix the issue where the parent window remained interactive after the modal window was opened in somecases.
This commit is contained in:
@@ -104,7 +104,8 @@ NativeWindow::NativeWindow(const gin_helper::Dictionary& options,
|
||||
transparent_{options.ValueOrDefault(options::kTransparent, false)},
|
||||
enable_larger_than_screen_{
|
||||
options.ValueOrDefault(options::kEnableLargerThanScreen, false)},
|
||||
is_modal_{parent != nullptr && options.ValueOrDefault("modal", false)},
|
||||
is_modal_{parent != nullptr &&
|
||||
options.ValueOrDefault(options::kModal, false)},
|
||||
has_frame_{options.ValueOrDefault(options::kFrame, true) &&
|
||||
title_bar_style_ == TitleBarStyle::kNormal},
|
||||
parent_{parent} {
|
||||
|
||||
@@ -553,7 +553,7 @@ bool NativeWindowViews::IsFocused() const {
|
||||
}
|
||||
|
||||
void NativeWindowViews::Show() {
|
||||
if (is_modal() && NativeWindow::parent() && !widget()->IsVisible())
|
||||
if (is_modal() && NativeWindow::parent())
|
||||
static_cast<NativeWindowViews*>(parent())->IncrementChildModals();
|
||||
|
||||
widget()->native_widget_private()->Show(GetRestoredState(), gfx::Rect());
|
||||
|
||||
@@ -222,6 +222,8 @@ inline constexpr std::string_view kSpellcheck = "spellcheck";
|
||||
inline constexpr std::string_view kEnableDeprecatedPaste =
|
||||
"enableDeprecatedPaste";
|
||||
|
||||
inline constexpr std::string_view kModal = "modal";
|
||||
|
||||
} // namespace options
|
||||
|
||||
// Following are actually command line switches, should be moved to other files.
|
||||
|
||||
Reference in New Issue
Block a user