diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2008-07-17 10:27:47 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2008-07-17 10:27:47 +0000 |
commit | f36810a40365da0da53fc50057df907c50993a67 (patch) | |
tree | 4760efce7af828fe4a1c5cf765d77d33cb2d80f2 /vcl/aqua/source | |
parent | 10cadfb7390f3c9dc33de7f41ce08d8db66baba7 (diff) |
INTEGRATION: CWS aquavcl09 (1.7.2); FILE MERGED
2008/07/10 10:30:04 pl 1.7.2.1: #i89611# do not special case Cmd-Option combinations
Diffstat (limited to 'vcl/aqua/source')
-rwxr-xr-x | vcl/aqua/source/app/vclnsapp.mm | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm index f935b477aff8..1fc9e6fc9f9e 100755 --- a/vcl/aqua/source/app/vclnsapp.mm +++ b/vcl/aqua/source/app/vclnsapp.mm @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: vclnsapp.mm,v $ - * $Revision: 1.7 $ + * $Revision: 1.8 $ * * This file is part of OpenOffice.org. * @@ -71,9 +71,10 @@ // a) Cmd-W is the same in all languages in OOo's menu conig // b) Cmd-W is the same in all languages in on MacOS // for now this seems to be true + unsigned int nModMask = ([pEvent modifierFlags] & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask)); if( (pFrame->mnStyleMask & NSClosableWindowMask) != 0 ) { - if( ([pEvent modifierFlags] & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask)) == NSCommandKeyMask + if( nModMask == NSCommandKeyMask && [[pEvent charactersIgnoringModifiers] isEqualToString: @"w"] ) { [pFrame->getWindow() windowShouldClose: nil]; @@ -81,28 +82,40 @@ } } - // dispatch to view directly to avoid the key event being consumed by the menubar - // popup windows do not get the focus, so they don't get these either - // simplest would be dispatch this to the key window always if it is without parent - // however e.g. in document we want the menu shortcut if e.g. the stylist has focus - if( pFrame->mpParent && (pFrame->mnStyle & SAL_FRAME_STYLE_FLOAT) == 0 ) + /* #i89611# + Cmd-Option-Space is for some reason not consumed by the menubar, + but also not by the input method (like e.g. Cmd-Space) and stays + without function. + + However MOD1 + MOD2 combinations are not used throughout OOo code + since they tend to clash with system shortcuts on all platforms so + we can skip this case here. + */ + if( nModMask != (NSCommandKeyMask | NSAlternateKeyMask) ) { - [[pKeyWin contentView] keyDown: pEvent]; + // dispatch to view directly to avoid the key event being consumed by the menubar + // popup windows do not get the focus, so they don't get these either + // simplest would be dispatch this to the key window always if it is without parent + // however e.g. in document we want the menu shortcut if e.g. the stylist has focus + if( pFrame->mpParent && (pFrame->mnStyle & SAL_FRAME_STYLE_FLOAT) == 0 ) + { + [[pKeyWin contentView] keyDown: pEvent]; + return; + } + + // see whether the main menu consumes this event + // if not, we want to dispatch it ourselves. Unless we do this "trick" + // the main menu just beeps for an unknown or disabled key equivalent + // and swallows the event wholesale + NSMenu* pMainMenu = [NSApp mainMenu]; + if( pMainMenu == 0 || ! [pMainMenu performKeyEquivalent: pEvent] ) + [[pKeyWin contentView] keyDown: pEvent]; + + // at this point either the menu has executed the accelerator + // or we have dispatched the event + // so no need to dispatch further return; } - - // see whether the main menu consumes this event - // if not, we want to dispatch it ourselves. Unless we do this "trick" - // the main menu just beeps for an unknown or disabled key equivalent - // and swallows the event wholesale - NSMenu* pMainMenu = [NSApp mainMenu]; - if( pMainMenu == 0 || ! [pMainMenu performKeyEquivalent: pEvent] ) - [[pKeyWin contentView] keyDown: pEvent]; - - // at this point either the menu has executed the accelerator - // or we have dispatched the event - // so no need to dispatch further - return; } } else if( eType == NSScrollWheel && ( GetSalData()->mnSystemVersion < VER_LEOPARD /* fixed in Leopard and above */ ) ) |