winemac: Allow programmatic changes of the window frame even if a window is disabled (prevented from resizing).

This commit is contained in:
Ken Thomases 2013-12-29 21:33:36 -06:00 committed by Alexandre Julliard
parent 8876751e93
commit 0137b07973

View file

@ -1231,6 +1231,16 @@ - (void) setFrameFromWine:(NSRect)contentRect
BOOL equalSizes = NSEqualSizes(frame.size, oldFrame.size);
BOOL needEnableScreenUpdates = FALSE;
if (disabled)
{
// Allow the following calls to -setFrame:display: to work even
// if they would violate the content size constraints. This
// shouldn't be necessary since the content size constraints are
// documented to not constrain that method, but it seems to be.
[self setContentMinSize:NSZeroSize];
[self setContentMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)];
}
if (equalSizes && [[self childWindows] count])
{
// If we change the window frame such that the origin moves
@ -1249,6 +1259,11 @@ - (void) setFrameFromWine:(NSRect)contentRect
}
[self setFrame:frame display:YES];
if (disabled)
{
[self setContentMinSize:contentRect.size];
[self setContentMaxSize:contentRect.size];
}
if (needEnableScreenUpdates)
NSEnableScreenUpdates();