There's no analogous state on Windows, where an app is focused but has no visible windows, but this seems like the best behavior.
Signed-off-by: Tim Clem tclem@codeweavers.com --- dlls/winemac.drv/cocoa_app.h | 1 + dlls/winemac.drv/cocoa_app.m | 12 ++++++++++++ dlls/winemac.drv/cocoa_window.m | 3 +++ 3 files changed, 16 insertions(+)
diff --git a/dlls/winemac.drv/cocoa_app.h b/dlls/winemac.drv/cocoa_app.h index 5db083d8e7bd..185ba2ceb707 100644 --- a/dlls/winemac.drv/cocoa_app.h +++ b/dlls/winemac.drv/cocoa_app.h @@ -158,6 +158,7 @@ - (void) noteKey:(uint16_t)keyCode pressed:(BOOL)pressed;
- (void) window:(WineWindow*)window isBeingDragged:(BOOL)dragged; - (void) windowWillStartLiveResize:(WineWindow*)window; + - (void) windowDidMiniaturize:(WineWindow*)window; - (void) windowWillOrderOut:(WineWindow*)window;
- (void) flipRect:(NSRect*)rect; diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index bace8b3973b1..bd2ef4c8b1e3 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -1546,6 +1546,18 @@ - (void) windowWillStartLiveResize:(WineWindow*)window [self stopClippingCursor]; }
+ - (void) windowDidMiniaturize:(WineWindow *)window + { + /* If all our windows are minimized, disable cursor clipping. */ + for (WineWindow* w in [NSApp windows]) + { + if ([w isKindOfClass:[WineWindow class]] && ![w isMiniaturized] && [w isVisible]) + return; + } + + [self stopClippingCursor]; + } + - (void) windowWillOrderOut:(WineWindow*)window { if ([windowsBeingDragged containsObject:window]) diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 2e63e9645189..883c70ded928 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -2898,6 +2898,9 @@ - (void)windowDidMiniaturize:(NSNotification *)notification { if (fullscreen && [self isOnActiveSpace]) [[WineApplicationController sharedController] updateFullscreenWindows]; + + [[WineApplicationController sharedController] windowDidMiniaturize:self]; + [self checkWineDisplayLink]; }