cef/patch/patches/win_shell_dialogs_3294.patch

30 lines
1.1 KiB
Diff

diff --git ui/shell_dialogs/base_shell_dialog_win.cc ui/shell_dialogs/base_shell_dialog_win.cc
index 46fd116c02dad..499bf49cff882 100644
--- ui/shell_dialogs/base_shell_dialog_win.cc
+++ ui/shell_dialogs/base_shell_dialog_win.cc
@@ -59,11 +59,15 @@ BaseShellDialogImpl::Owners& BaseShellDialogImpl::GetOwners() {
// 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
@@ -89,6 +93,8 @@ void BaseShellDialogImpl::EndRun(std::unique_ptr<RunState> run_state) {
}
bool BaseShellDialogImpl::IsRunningDialogForOwner(HWND owner) const {
+ if (owner)
+ owner = GetAncestor(owner, GA_ROOT);
return (owner && GetOwners().find(owner) != GetOwners().end());
}