Commit 2fcf40a6 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

winemac.drv: Fix minimizing windows when Stage Manager is enabled.

parent e8943a64
...@@ -161,6 +161,21 @@ static inline NSUInteger adjusted_modifiers_for_settings(NSUInteger modifiers) ...@@ -161,6 +161,21 @@ static inline NSUInteger adjusted_modifiers_for_settings(NSUInteger modifiers)
return new_modifiers; return new_modifiers;
} }
static inline BOOL stage_manager_enabled(void)
{
/* There is no documented way to determine if Stage Manager is enabled,
* but this seems like the best option.
*/
if (floor(NSAppKitVersionNumber) >= 2299 /* NSAppKitVersionNumber13_0 */)
{
NSUserDefaults *defs = [[NSUserDefaults alloc] initWithSuiteName:@"com.apple.WindowManager.plist"];
BOOL enabled = [defs boolForKey:@"GloballyEnabled"];
[defs release];
return enabled;
}
return FALSE;
}
@interface NSWindow (WineAccessPrivateMethods) @interface NSWindow (WineAccessPrivateMethods)
- (id) _displayChanged; - (id) _displayChanged;
...@@ -2576,6 +2591,16 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi ...@@ -2576,6 +2591,16 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
- (void) miniaturize:(id)sender - (void) miniaturize:(id)sender
{ {
/* When Stage Manager is enabled, miniaturize: just moves the app/window to
* the background rather than minimizing the window.
* Don't start minimizing the window on the Win32 side.
*/
if (stage_manager_enabled())
{
[super miniaturize:sender];
return;
}
macdrv_event* event = macdrv_create_event(WINDOW_MINIMIZE_REQUESTED, self); macdrv_event* event = macdrv_create_event(WINDOW_MINIMIZE_REQUESTED, self);
[queue postEvent:event]; [queue postEvent:event];
macdrv_release_event(event); macdrv_release_event(event);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment