Skip to contentSkip to conversation

ui/cocoa: Respect left-command-key option

PATCH In review Akihiko Odaki 2 participants 3 messages Mar 17, 2022 – Mar 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ui/cocoa: Respect left-command-key option

---
 ui/cocoa.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
ui/cocoa.m +2 -1
index cb6e7c41dc6..c4e5468f9e6 100644
@@ -923,7 +923,8 @@ - (bool) handleEventLocked:(NSEvent *)event
                 /* Don't pass command key changes to guest unless mouse is grabbed */
                 case kVK_Command:
                     if (isMouseGrabbed &&
-                        !!(modifiers & NSEventModifierFlagCommand)) {
+                        !!(modifiers & NSEventModifierFlagCommand) &&
+                        left_command_key_enabled) {
                         if (swap_opt_cmd) {
                             [self toggleKey:Q_KEY_CODE_ALT];
                         } else {
Signature · 1 line
2.32.0 (Apple Git-132)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Akihiko Odaki
---
  ui/cocoa.m | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
ui/cocoa.m +0 -0
index cb6e7c41dc6..c4e5468f9e6 100644

ui/cocoa.m - (bool) handleEventLocked:(NSEvent *)event · line 927

Quoted 6 lines
ui/cocoa.m +2 -1
@@ -923,7 +923,8 @@ - (bool) handleEventLocked:(NSEvent *)event
                  /* Don't pass command key changes to guest unless mouse is grabbed */
                  case kVK_Command:
                      if (isMouseGrabbed &&
-                        !!(modifiers & NSEventModifierFlagCommand)) {
+                        !!(modifiers & NSEventModifierFlagCommand) &&
+                        left_command_key_enabled) {

My bad for trying to resolve merge conflict myself sigh :(

Fixes 4797adce5f ("ui/cocoa: add option to swap Option and Command")
Quoted 3 lines
ui/cocoa.m +0 -0
                          if (swap_opt_cmd) {
                              [self toggleKey:Q_KEY_CODE_ALT];
                          } else {