|
From: | Adrian Robert |
Subject: | Re: Patch: NSApplication -beginModalSessionForWindow: |
Date: | Wed, 26 Jan 2005 10:41:23 -0500 |
On Jan 26, 2005, at 9:55 AM, Frederic Stark wrote:
Adrian Robert wrote:Hi all, Experimenting some more with the runModal... code in NSApplication, I noticed that OS X does not center the panel in -beginModalSessionForWindow: if it is already visible. The attached patch does this, and documents this change and the related one to -runModalSession: last week (which also matches OS X behavior). The major user code visible effect is that panels that were already on-screen will not be moved to the center when beginning a modal session. I wanted to check if anyone is relying on this behavior before committing..I may have misread the path, but at first glance, it looks like it would not raise the window if it is already on screen... Seems weird.Wouldn't the intend more precisely encoded in: if ([theWindow isKindOfClass: [NSPanel class]]) { if ([theWindow isVisible] == NO) [theWindow center]; [theWindow setLevel: NSModalPanelWindowLevel]; }
Thanks, I think you're right. And it becomes just a 1-line change.
[Prev in Thread] | Current Thread | [Next in Thread] |