mirror of
https://github.com/electron/electron.git
synced 2026-01-25 07:18:18 -05:00
Use class extension to avoid type conversion
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
#include "content/public/browser/native_web_keyboard_event.h"
|
||||
#include "ui/events/keycodes/keyboard_codes.h"
|
||||
|
||||
@interface NSWindow (EventDispatchingWindow)
|
||||
- (void)redispatchKeyEvent:(NSEvent*)event;
|
||||
@end
|
||||
|
||||
namespace atom {
|
||||
|
||||
void CommonWebContentsDelegate::HandleKeyboardEvent(
|
||||
@@ -24,7 +28,7 @@ void CommonWebContentsDelegate::HandleKeyboardEvent(
|
||||
ExitFullscreenModeForTab(source);
|
||||
|
||||
if (event.os_event.window)
|
||||
[(EventDispatchingWindow*)event.os_event.window redispatchKeyEvent:event.os_event];
|
||||
[event.os_event.window redispatchKeyEvent:event.os_event];
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
||||
Reference in New Issue
Block a user