[PATCH] winemac.drv: Allow cycling of windows with Cmd+`.

Tim Clem tclem at codeweavers.com
Thu Sep 9 17:31:56 CDT 2021


We already set up the Window menu and set the relevant bits in
collectionBehavior, but windows must respond YES to
-canBecomeKeyWindow in order to actually be activated by Cmd+`
window cycling.

Signed-off-by: Tim Clem <tclem at codeweavers.com>
---
I tested to make sure this doesn't change keyboard events,
and it doesn't. Cocoa consumes Cmd+` early, so Windows apps
already weren't getting any keypresses related to it.

All other window focus behavior is unchanged by this patch,
since the disabled and noActivate checks remain in place
and take priority.

 dlls/winemac.drv/cocoa_window.m | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index 0926756c875..80cb2693409 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -2358,7 +2358,11 @@ - (BOOL) canBecomeKeyWindow
     {
         if (causing_becomeKeyWindow == self) return YES;
         if (self.disabled || self.noActivate) return NO;
-        return [self isKeyWindow];
+        if ([self isKeyWindow]) return YES;
+
+        // If a window's collectionBehavior says it participates in cycling,
+        // it must return YES from this method to actually be eligible.
+        return ![self isExcludedFromWindowsMenu];
     }
 
     - (BOOL) canBecomeMainWindow
-- 
2.32.0




More information about the wine-devel mailing list