Skip to content

Commit

Permalink
MacOSX: Make wxWebviewWebkit capture hotkeys less eagerly.
Browse files Browse the repository at this point in the history
On MacOSX, the wxWebviewWebkit will eagerly capture the hotkeys despite the fact
that it might be the one in focus. This will interfere other widgets' functions.
It should only handle the hotkeys when it is the firstResponder.

More about firstResponder:
https://developer.apple.com/documentation/appkit/nswindow/1419440-firstresponder
  • Loading branch information
徐扬斌 committed Apr 29, 2024
1 parent 6f4f244 commit f4eb6c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/osx/webview_webkit.mm
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,10 @@ -(id)validRequestorForSendType:(NSString*)sendType returnType:(NSString*)returnT

- (BOOL)performKeyEquivalent:(NSEvent *)event
{
if (self.window.firstResponder != self)
{
return NO;
}
if ([event modifierFlags] & NSCommandKeyMask)
{
switch ([event.characters characterAtIndex:0])
Expand Down

0 comments on commit f4eb6c3

Please sign in to comment.