I've created a pretty trivial case that makes this happen:

NSWindow * ontop = [[NSWindow alloc] initWithContentRect:NSMakeRect(100.0, 100.0, 300.0, 400.0) styleMask:NSTitledWindowMask | NSClosableWindowMask backing:NSBackingStoreBuffered defer:NO]; NSWindow * onback = [[NSWindow alloc] initWithContentRect:NSMakeRect(100.0, 100.0, 500.0, 400.0) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];

    [onback setContentView:[[View alloc] init]];

    [ontop makeKeyAndOrderFront:self];
    [ontop addChildWindow:onback ordered:NSWindowBelow];

    [ontop setLevel:3];

The onback window ends up on top after this (which makes no sense to me). Changing defer: from YES to NO doesn't do anything useful.

On Oct 20, 2009, at 11:40 AM, Jesper Storm Bache wrote:

Your analysis (regarding window visibility) sounds plausible as non-
visible Cocoa windows have no "z-order".
I have logged: "6802899 Please add latent z-order to hidden NSWindows"
for this, but in the meantime I am left with having to move "hidden"
windows off screen and make then visible (then override
constrainFrameRect to not move the window back on screen).

Jesper Storm Bache

On Oct 20, 2009, at 10:43 AM, Francisco Tolmasky wrote:

The title says it all, I set up a child window as such:

       [targetWindow addChildWindow:self ordered:NSWindowBelow];

But the child window shows up on top of "targetWindow" until the first
click, at which point it immediately reorders itself to the back and
behaves correctly from that point forward. My suspicion is that it has
something to do with the fact that I set the child window before
"targetWindow" is visible, but given the structure of the code it
would be difficult to do otherwise (although not impossible if that is
the only way to fix this problem). Are there any known issues or
perhaps something obvious that I am doing incorrectly?

Thanks,

Francisco

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/jsbache%40adobe.com

This email sent to jsba...@adobe.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to