mac: Fix handling event from other windows.
This commit is contained in:
parent
74fe964f75
commit
81eedd4faf
1 changed files with 11 additions and 4 deletions
|
@ -504,10 +504,17 @@ void NativeWindowMac::HandleKeyboardEvent(
|
||||||
event.type == content::NativeWebKeyboardEvent::Char)
|
event.type == content::NativeWebKeyboardEvent::Char)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EventProcessingWindow* event_window =
|
if (event.os_event.window == window_) {
|
||||||
static_cast<EventProcessingWindow*>(window_);
|
EventProcessingWindow* event_window =
|
||||||
DCHECK([event_window isKindOfClass:[EventProcessingWindow class]]);
|
static_cast<EventProcessingWindow*>(window_);
|
||||||
[event_window redispatchKeyEvent:event.os_event];
|
DCHECK([event_window isKindOfClass:[EventProcessingWindow class]]);
|
||||||
|
[event_window redispatchKeyEvent:event.os_event];
|
||||||
|
} else {
|
||||||
|
// The event comes from detached devtools view, and it has already been
|
||||||
|
// handled by the devtools itself, we now send it to application menu to
|
||||||
|
// make menu acclerators work.
|
||||||
|
[[NSApp mainMenu] performKeyEquivalent:event.os_event];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowMac::InstallView() {
|
void NativeWindowMac::InstallView() {
|
||||||
|
|
Loading…
Reference in a new issue