summaryrefslogtreecommitdiff
path: root/vcl/inc/osx/salnsmenu.h
diff options
context:
space:
mode:
authorPatrick Luby <guibmacdev@gmail.com>2024-10-03 19:47:25 -0400
committerPatrick Luby <guibomacdev@gmail.com>2024-10-08 20:31:29 +0200
commit9240debe362a382389e7601073523162ea0cd80d (patch)
tree9d6b67e83a636f1a0a3dce7c85750e96cedbbd74 /vcl/inc/osx/salnsmenu.h
parent73c51868a1f2889edbd7565a80645b04ef8db2f9 (diff)
tdf#162843 replace the event's string parameters
When using the Dvorak - QWERTY keyboard, the event's charactersIgnoringModifiers string causes pasting to fail so replace both the event's characters and charactersIgnoringModifiers strings with this menu item's key equivalent. Also, fix the following related bugs when using the Dvorak - QWERTY keyboard: - When pressing Command-V with a Dvorak - QWERTY keyboard, that single event passes through the -[SalNSMainMenu performKeyEquivalent:] selector twice which causes content to be pasted twice in any text fields in the Find and Replace dialog. - When using the Dvorak - QWERTY keyboard and the Command key is pressed, any key events that match a disabled menu item are handled in the -[SalFrameView noop:]. However, the Dvorak - QWERTY event's charactersIgnoringModifiers string can cause cutting and copying to fail in the Find toolbar and the Find and Replace dialog so replace the event's charactersIgnoringModifiers string with the event's character string. Lastly, fix temporarily disabled menu items failing to be reenabled when a modal dialog closes caused by the fix for tdf#126638 by returning the last enabled state set by the LibreOffice code. Apparently whatever is returned by -[SalNSMenuItem validateMenuItem:] will be passed to -[NSMenuItem setEnabled:] which can cause the enabled state to be different than the enabled state that the LibreOffice code expoects. This results in menu items failing to be reenabled after being temporarily disabled such as when a native modal dialog is closed. So, return the last enabled state set by the LibreOffice code. Change-Id: Iae9cc6f1b94484c1529b22ea3a7acdac2009a58b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174462 Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Diffstat (limited to 'vcl/inc/osx/salnsmenu.h')
-rw-r--r--vcl/inc/osx/salnsmenu.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/inc/osx/salnsmenu.h b/vcl/inc/osx/salnsmenu.h
index 9e0f9acf68ed..d6b065a7706e 100644
--- a/vcl/inc/osx/salnsmenu.h
+++ b/vcl/inc/osx/salnsmenu.h
@@ -44,15 +44,21 @@ class AquaSalMenuItem;
@interface SalNSMenuItem : NSMenuItem <NSMenuItemValidation>
{
AquaSalMenuItem* mpMenuItem;
+ BOOL mbReallyEnabled;
}
- (id)initWithMenuItem:(AquaSalMenuItem*)pMenuItem;
+- (BOOL)isReallyEnabled;
- (void)menuItemTriggered:(id)aSender;
- (BOOL)validateMenuItem:(NSMenuItem*)pMenuItem;
+- (void)setReallyEnabled:(BOOL)bEnabled;
@end
@interface SalNSMainMenu : NSMenu
{
+ NSEvent* mpLastPerformKeyEquivalentEvent;
}
+- (id)initWithTitle:(NSString*)pTitle;
+- (void)dealloc;
- (BOOL)performKeyEquivalent:(NSEvent*)pEvent;
@end