forked from Mirrors/wine-wine
winemac: Avoid moving owned windows when programmatically moving the owner.
Cocoa normally maintains the relative position of owned windows with respect to the owner, which differs from Windows.oldstable
parent
784a91390e
commit
3a03dcf097
|
@ -64,6 +64,7 @@
|
|||
NSTimeInterval enteredFullScreenTime;
|
||||
|
||||
BOOL ignore_windowDeminiaturize;
|
||||
BOOL ignore_windowResize;
|
||||
BOOL fakingClose;
|
||||
}
|
||||
|
||||
|
|
|
@ -1190,14 +1190,34 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
|
|||
frame = [self frameRectForContentRect:contentRect];
|
||||
if (!NSEqualRects(frame, oldFrame))
|
||||
{
|
||||
if (NSEqualSizes(frame.size, oldFrame.size))
|
||||
[self setFrameOrigin:frame.origin];
|
||||
else
|
||||
BOOL equalSizes = NSEqualSizes(frame.size, oldFrame.size);
|
||||
BOOL needEnableScreenUpdates = FALSE;
|
||||
|
||||
if (equalSizes && [[self childWindows] count])
|
||||
{
|
||||
[self setFrame:frame display:YES];
|
||||
[self updateColorSpace];
|
||||
// If we change the window frame such that the origin moves
|
||||
// but the size doesn't change, then Cocoa moves child
|
||||
// windows with the parent. We don't want that so we fake
|
||||
// a change of the size and then change it back.
|
||||
NSRect bogusFrame = frame;
|
||||
bogusFrame.size.width++;
|
||||
|
||||
NSDisableScreenUpdates();
|
||||
needEnableScreenUpdates = TRUE;
|
||||
|
||||
ignore_windowResize = TRUE;
|
||||
[self setFrame:bogusFrame display:NO];
|
||||
ignore_windowResize = FALSE;
|
||||
}
|
||||
|
||||
[self setFrame:frame display:YES];
|
||||
|
||||
if (needEnableScreenUpdates)
|
||||
NSEnableScreenUpdates();
|
||||
|
||||
if (!equalSizes)
|
||||
[self updateColorSpace];
|
||||
|
||||
if (!enteringFullScreen &&
|
||||
[[NSProcessInfo processInfo] systemUptime] - enteredFullScreenTime > 1.0)
|
||||
nonFullscreenFrame = frame;
|
||||
|
@ -1683,7 +1703,7 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
|
|||
macdrv_event* event;
|
||||
NSRect frame = [self contentRectForFrameRect:[self frame]];
|
||||
|
||||
if (exitingFullScreen) return;
|
||||
if (ignore_windowResize || exitingFullScreen) return;
|
||||
|
||||
if (self.disabled)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue