2022-04-08 22:48:56 +02:00
|
|
|
diff --git ui/shell_dialogs/base_shell_dialog_win.cc ui/shell_dialogs/base_shell_dialog_win.cc
|
2023-01-30 18:43:54 +01:00
|
|
|
index 138167d4c0105..81562ffdd2162 100644
|
2022-04-08 22:48:56 +02:00
|
|
|
--- ui/shell_dialogs/base_shell_dialog_win.cc
|
|
|
|
+++ ui/shell_dialogs/base_shell_dialog_win.cc
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -59,11 +59,15 @@ BaseShellDialogImpl::Owners& BaseShellDialogImpl::GetOwners() {
|
2022-04-08 22:48:56 +02:00
|
|
|
|
|
|
|
// static
|
|
|
|
void BaseShellDialogImpl::DisableOwner(HWND owner) {
|
|
|
|
+ if (owner)
|
|
|
|
+ owner = GetAncestor(owner, GA_ROOT);
|
|
|
|
SetOwnerEnabled(owner, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::unique_ptr<BaseShellDialogImpl::RunState> BaseShellDialogImpl::BeginRun(
|
|
|
|
HWND owner) {
|
|
|
|
+ if (owner)
|
|
|
|
+ owner = GetAncestor(owner, GA_ROOT);
|
|
|
|
// Cannot run a modal shell dialog if one is already running for this owner.
|
|
|
|
DCHECK(!IsRunningDialogForOwner(owner));
|
|
|
|
// The owner must be a top level window, otherwise we could end up with two
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -89,6 +93,8 @@ void BaseShellDialogImpl::EndRun(std::unique_ptr<RunState> run_state) {
|
2022-04-08 22:48:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool BaseShellDialogImpl::IsRunningDialogForOwner(HWND owner) const {
|
|
|
|
+ if (owner)
|
|
|
|
+ owner = GetAncestor(owner, GA_ROOT);
|
|
|
|
return (owner && GetOwners().find(owner) != GetOwners().end());
|
|
|
|
}
|
|
|
|
|