vcl/inc/osx/salframeview.h |    1 +
 vcl/osx/salframeview.mm    |   14 ++++++++++++++
 2 files changed, 15 insertions(+)

New commits:
commit e5ec093ebfd7115509eb7a0feb1a36e0a479f497
Author:     Dan Williams <[email protected]>
AuthorDate: Wed Feb 11 08:42:24 2026 -0800
Commit:     Dan Williams <[email protected]>
CommitDate: Wed Feb 18 13:49:21 2026 +0100

    vcl/osx: hook up Ctrl+Return for keyboard-triggered context menus
    
    Change-Id: Iaf115ab652167fdb3784ba3eb17f74ae7c260f9c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199193
    Tested-by: Jenkins
    Reviewed-by: Dan Williams <[email protected]>
    Reviewed-by: Patrick Luby <[email protected]>
    (cherry picked from commit c4b63c07980599a26e99b7c7ba583be820b901bb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199510

diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index bd8671ef7d8e..35b151de3b27 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -146,6 +146,7 @@ enum class SalEvent;
 -(void)magnifyWithEvent: (NSEvent*)pEvent;
 -(void)rotateWithEvent: (NSEvent*)pEvent;
 -(void)swipeWithEvent: (NSEvent*)pEvent;
+-(void)contextMenuKeyDown: (NSEvent*)pEvent;
 -(void)keyDown: (NSEvent*)pEvent;
 -(void)flagsChanged: (NSEvent*)pEvent;
 -(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(sal_uInt16)nButton 
eventtype:(SalEvent)nEvent;
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 637b4d32fc02..06b31daa245c 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1691,6 +1691,20 @@ static NSString* getCurrentSelection()
     }
 }
 
+-(void)contextMenuKeyDown: (NSEvent*)pEvent
+{
+    SolarMutexGuard aGuard;
+
+    vcl::Window *pWin = ImplGetSVData()->mpWinData->mpFocusWin;
+    if( pWin )
+    {
+        CommandEvent aCEvt(Point(), CommandEventId::ContextMenu, false);
+        NotifyEvent aNCmdEvt( NotifyEventType::COMMAND, pWin, &aCEvt );
+
+        if ( !ImplCallPreNotify( aNCmdEvt ) )
+            pWin->Command( aCEvt );
+    }
+}
 
 -(void)keyDown: (NSEvent*)pEvent
 {

Reply via email to