Re: window:willPositionSheet:usingRect: not called in full-screen mode
Re: window:willPositionSheet:usingRect: not called in full-screen mode
- Subject: Re: window:willPositionSheet:usingRect: not called in full-screen mode
- From: Corbin Dunn <email@hidden>
- Date: Fri, 27 Feb 2015 09:24:05 -0800
> On Feb 25, 2015, at 9:40 AM, Lee Ann Rucker <email@hidden> wrote:
>
>> Great, because that's exactly what I'm using it for
>
> The toolbar case or the "certain control" one? When you're in fullscreen mode, the toolbar isn't actually attached to your window. It's attached to a separate one so it can slide down with the menubar. But if it’s the control, it wouldn't surprise me if Apple forgot they'd mentioned that option and didn't think about it when they decided whether this delegate method needed to be called.
This was thought about. The delegate isn’t called because, as you all noted, the sheet is appearing in another window that the application doesn’t own. AppKit takes care of drawing the titlebar, toolbar, and titlebar accessory views (new to 10.10). Sheets are designed to drop below all these, and move with the window when the menu bar drops down.
Arjan:
> Does anyone know what I can do to make the framework call
> window:willPositionSheet:usingRect:, even in full-screen mode?
Yes, I know, and the answer is no, you can’t in full screen mode get that delegate call.
> Or if not,
> what other way should I use to position the sheet that will work in all
> situations?
You shouldn’t have to… can you describe exactly what you are trying to do and log a bug requesting we start calling the delegate? Pictures would be extremely helpful in a case like this.
corbin
>
> ________________________________________
> From: cocoa-dev-bounces+lrucker=email@hidden [cocoa-dev-bounces+lrucker=email@hidden] on behalf of Arjan van Leeuwen [email@hidden]
> Sent: Wednesday, February 25, 2015 6:47 AM
> To: email@hidden
> Subject: window:willPositionSheet:usingRect: not called in full-screen mode
>
> Hi,
>
> To open a save file sheet, I'm starting an NSSavePanel as a sheet
> via beginSheetModalForWindow:completionHandler:. Because my application
> needs custom positioning for the sheet, the window delegate of my main
> window overrides window:willPositionSheet:usingRect:. According to the
> documentation, this
>
> Tells the delegate that the window is about to show a sheet at the
>> specified location, giving it the opportunity to return a custom location
>> for the attachment of the sheet to the window.
>
>
> And
>
> This method is useful in many situations. If your window has a toolbar, for
>> example, you can specify a location for the sheet that is just below it. If
>> you want the sheet associated with a certain control or view, you could
>> position the sheet so that it appears to originate from the object (through
>> animation) or is positioned next to it.
>
>
> Great, because that's exactly what I'm using it for :). However, when my
> app is in full-screen mode, this function never gets called. Other related
> delegate functions, like windowWillBeginSheet: and windowDidEndSheet: do
> get called correctly on the delegate, so the delegate is obviously still
> there and as far as I can see should be receiving a call to
> window:willPositionSheet:usingRect:.
>
> Does anyone know what I can do to make the framework call
> window:willPositionSheet:usingRect:, even in full-screen mode? Or if not,
> what other way should I use to position the sheet that will work in all
> situations?
>
> Thanks,
>
> Arjan
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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:
>
> This email sent to email@hidden
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden