On Mar 13, 2015, at 4:29 PM, Daryle Walker <[email protected]> wrote:

> My main browser window supports full-screen and optimized zoom. In Yosemite, 
> those two functions share the green titlebar button. When I activate 
> full-screen mode, with either the green button or the menu item, the window 
> freezes without any visual change. The window can’t be moved or shifted out 
> of the way upon switching apps. (The window doesn’t corrupt other Spaces, 
> though.) The rest of the app still works, but new windows are always beneath 
> the frozen one.
> 
> When trying full-screen, this appears on the Xcode debug log:
> 
>> 2015-03-13 17:17:18.850 Prairie[7319:1920249] *** Assertion failure in 
>> -[PrBrowserController windowWillUseStandardFrame:defaultFrame:], 
>> /Users/.../Prairie/PrBrowserController.m:297
>> 2015-03-13 17:17:18.856 Prairie[7319:1920249] An uncaught exception was 
>> raised
>> 2015-03-13 17:17:18.857 Prairie[7319:1920249] Standard web-browser window 
>> size too tall.

You have an assertion in your code.  The assertion is failing and thus throwing 
an exception.  Once that happens, stuff is broken.  This is the expected 
consequence of an assertion failing or an exception being thrown.  The nature 
of the resulting brokenness is not predictable or diagnostic.


> Why is my optimized-zoom sizing method called during a full-screen adjustment?

Because it's not just for zoom.  It's for computing the standard frame.


> Here’s my zoom sizing method:
> 
>> - (NSRect)windowWillUseStandardFrame:(NSWindow *)window 
>> defaultFrame:(NSRect)newFrame {
>>    NSParameterAssert(self.window == window);
>> 
>>    // Based on the web content, get the maximum desired width and height.
>>    NSView<WebDocumentView> * const  view = 
>> self.webView.mainFrame.frameView.documentView;
>>    NSSize const       desiredContentSize = NSMakeSize(NSWidth(view.frame), 
>> NSHeight(view.frame) + ((CGFloat)!!self.isLoadingBarVisible * 
>> PrLoadingBarHeight) + ((CGFloat)!!self.isStatusBarVisible * 
>> PrStatusBarHeight));
>> 
>>    // Adjust that desired size to what's actually available.
>>    NSRect  frame = [window contentRectForFrameRect:newFrame];
>> 
>>    frame.size.width = MIN(desiredContentSize.width, frame.size.width);
>>    frame.size.height = MIN(desiredContentSize.height, frame.size.height);
>> 
>>    // Adjust to the window's size bounds.
>>    frame = [window frameRectForContentRect:frame];
>>    frame.size.width = MAX(window.minSize.width, frame.size.width);
>>    frame.size.height = MAX(window.minSize.height, frame.size.height);
>>    NSAssert(frame.size.width <= newFrame.size.width, @"Standard web-browser 
>> window size too wide.");
>>    NSAssert(frame.size.height <= newFrame.size.height, @"Standard 
>> web-browser window size too tall.");

Why do you think those are legitimate things to assert?  Have you checked the 
values involved and the inputs to the computation?

Regards,
Ken


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to