fix: Fix broken globalShortcuts.registerAll() on non-macOS platforms (#20963)
This was a regression in #16125, which unintentionally put `GlobalShortcutListener::RegisterAccelerator` into a `#if defined(OS_MACOSX)` block. Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
This commit is contained in:
parent
05de7277ab
commit
ac69b89e82
1 changed files with 2 additions and 8 deletions
|
@ -74,19 +74,13 @@ bool GlobalShortcut::RegisterAll(
|
||||||
std::vector<ui::Accelerator> registered;
|
std::vector<ui::Accelerator> registered;
|
||||||
|
|
||||||
for (auto& accelerator : accelerators) {
|
for (auto& accelerator : accelerators) {
|
||||||
#if defined(OS_MACOSX)
|
if (!Register(accelerator, callback)) {
|
||||||
if (RegisteringMediaKeyForUntrustedClient(accelerator))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
GlobalShortcutListener* listener = GlobalShortcutListener::GetInstance();
|
|
||||||
if (!listener->RegisterAccelerator(accelerator, this)) {
|
|
||||||
// unregister all shortcuts if any failed
|
// unregister all shortcuts if any failed
|
||||||
UnregisterSome(registered);
|
UnregisterSome(registered);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
registered.push_back(accelerator);
|
registered.push_back(accelerator);
|
||||||
accelerator_callback_map_[accelerator] = callback;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue