Commit 0137b079 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Allow programmatic changes of the window frame even if a window is…

winemac: Allow programmatic changes of the window frame even if a window is disabled (prevented from resizing).
parent 8876751e
......@@ -1231,6 +1231,16 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
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 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
}
[self setFrame:frame display:YES];
if (disabled)
{
[self setContentMinSize:contentRect.size];
[self setContentMaxSize:contentRect.size];
}
if (needEnableScreenUpdates)
NSEnableScreenUpdates();
......
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