mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 03:50:21 +00:00
winemac.drv: Fix minimizing windows when Stage Manager is enabled.
This commit is contained in:
parent
e8943a6463
commit
2fcf40a6e1
|
@ -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 @@ - (void) sendEvent:(NSEvent*)event
|
||||||
|
|
||||||
- (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);
|
||||||
|
|
Loading…
Reference in a new issue