fixes #13557
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -237,15 +237,38 @@ void wxBell()
|
|||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
// here we subclass NSApplication, for the purpose of being able to override sendEvent.
|
||||||
|
@interface wxNSApplication : NSApplication
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)sendEvent:(NSEvent *)anEvent;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation wxNSApplication
|
||||||
|
|
||||||
|
/* This is needed because otherwise we don't receive any key-up events for command-key
|
||||||
|
combinations (an AppKit bug, apparently) */
|
||||||
|
- (void)sendEvent:(NSEvent *)anEvent
|
||||||
|
{
|
||||||
|
if ([anEvent type] == NSKeyUp && ([anEvent modifierFlags] & NSCommandKeyMask))
|
||||||
|
[[self keyWindow] sendEvent:anEvent];
|
||||||
|
else [super sendEvent:anEvent];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
wxNSAppController* appcontroller = nil;
|
wxNSAppController* appcontroller = nil;
|
||||||
|
|
||||||
bool wxApp::DoInitGui()
|
bool wxApp::DoInitGui()
|
||||||
{
|
{
|
||||||
wxMacAutoreleasePool pool;
|
wxMacAutoreleasePool pool;
|
||||||
[NSApplication sharedApplication];
|
|
||||||
|
|
||||||
if (!sm_isEmbedded)
|
if (!sm_isEmbedded)
|
||||||
{
|
{
|
||||||
|
[wxNSApplication sharedApplication];
|
||||||
|
|
||||||
appcontroller = [[wxNSAppController alloc] init];
|
appcontroller = [[wxNSAppController alloc] init];
|
||||||
[NSApp setDelegate:appcontroller];
|
[NSApp setDelegate:appcontroller];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user