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.
This commit is contained in:
parent
784a91390e
commit
3a03dcf097
|
@ -64,6 +64,7 @@ @interface WineWindow : NSPanel <NSWindowDelegate>
|
|||
NSTimeInterval enteredFullScreenTime;
|
||||
|
||||
BOOL ignore_windowDeminiaturize;
|
||||
BOOL ignore_windowResize;
|
||||
BOOL fakingClose;
|
||||
}
|
||||
|
||||
|
|
|
@ -1190,14 +1190,34 @@ - (void) setFrameFromWine:(NSRect)contentRect
|
|||
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 @@ - (void)windowDidResize:(NSNotification *)notification
|
|||
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