Skip to content

Fix uiAreaBeginUserWindowResize on macOS - #385

Open
mischnic wants to merge 2 commits into
andlabs:masterfrom
mischnic:area-size-mac
Open

mischnic wants to merge 2 commits into
andlabs:masterfrom
mischnic:area-size-mac

Conversation

@mischnic

@mischnic mischnic commented Jun 1, 2018

Copy link
Copy Markdown
Contributor
  • CGFLOAT_MAX isn't a valid value for a constraint

  • The position (= origin) of the window changes when resizing on the left or bottom edge and needs to be adjusted while resizing.

Fixes #357

@mischnic

mischnic commented Aug 3, 2018

Copy link
Copy Markdown
Contributor Author

// maximum: encourage the window to be as large as possible
contentView = [w contentView];
cw = uiprivMkConstraint(contentView, NSLayoutAttributeWidth,
NSLayoutRelationEqual,
nil, NSLayoutAttributeNotAnAttribute,
0, CGFLOAT_MAX,
@"window maximum width finding constraint");
[cw setPriority:NSLayoutPriorityDragThatCanResizeWindow];
[contentView addConstraint:cw];

Is there a case where a window with an uiArea can't grow infinitely large? There are no "non-stretchy" uiArea with a fixed size.

@andlabs

andlabs commented Aug 3, 2018

Copy link
Copy Markdown
Owner

Not yet, but there will be.

@mischnic

mischnic commented Aug 3, 2018

Copy link
Copy Markdown
Contributor Author

Could it (a max width/height) somehow occur with another control in the window?

bildschirmfoto 2018-08-03 um 14 16 22

So is 100000 as maximum contraint width/height fine for now, because there is no SOMETHING_MAX value that works?

@andlabs

andlabs commented Aug 3, 2018

Copy link
Copy Markdown
Owner

The fact there is no such constant is the reason why I was using CGFLOAT_MAX. I suppose I could make 100000 a constant, but I still wonder why this fails now on Sierra.

@mischnic

mischnic commented Aug 3, 2018

Copy link
Copy Markdown
Contributor Author

The largest possible value that works (High Sierra) is 4294967384.0, which is UINT_MAX + 89.

@mischnic

Copy link
Copy Markdown
Contributor Author

What keeps this from getting merged? Even if this might not be a perfect solution (although there seems to be no case in which the maximum size constraint has any effect) , it's still better than the application crashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants