10.13, full-screen sheet windows and the dock

I have a fullscreen window which has a sheet window which will be shown within it.

The parent window has frame type 0, and the sheet window has frame type 8. Both windows have .fullScreen=true and .menuBarVisible=false.

To show the sheet window, I make this call

 child.showWithin parent

which animates the sheet window sliding in.

In 10.12 and earlier this works fine.

In 10.13, it works fine on secondary monitors, but on Screen 0 when I call .showWithin the parent window slides up (or to the left or right) to make room for the dock, although the dock itself isn’t visible.

Anyone seen anything like this?

I notice the 10.13 release notes say this:

NSWindow Implicit Full Screen

NSWindow no longer checks if a resizable window can be resized to the current screen's frame to make the window implicitly full screen capable. It now relies on NSWindowStyleMaskResizable without the additional min/max size check. As in 10.11, the exact semantics of this may change over time, and it is recommended to explicitly opt in primary document windows by including NSWindowCollectionBehaviorFullScreenPrimary in the collectionBehavior.

https://developer.apple.com/library/content/releasenotes/AppKit/RN-AppKit/

But I’m not sure exactly what that means.

It says that we (Apple) keep fucking with the green button.

In all honesty have you considered not using a sheet window? IIRC a sheet window is meant to be a simple dialog that’s attached to the main window.

[quote=350848:@Sam Rowlands]It says that we (Apple) keep fucking with the green button.

In all honesty have you considered not using a sheet window? IIRC a sheet window is meant to be a simple dialog that’s attached to the main window.[/quote]

The nice thing about a sheet window is that it gives the animation when it appears, and it also stays attached to the parent window if you move it around. It’s great for what I need it. This new behavior I’m seeing is only in 10.13, only in fullscreen mode, and only on monitor 0, so I’m thinking maybe it’s just a highSierra bug. I tried a bunch of workarounds but haven’t found anything yet.

Why is your sheet window set to fullscreen, too? I just checked with my own app. Only the main window is set to fullscreen. The sheet window is not and everything looks fine on High Sierra.

= tell us if you want your windows to be full-screen enabled.

NSWindow no longer checks if a resizable window can be resized to the current screen's frame to make the window implicitly full screen capable. ..without the additional min/max size check

= but even if you dont, we’ll assume it anyway! As Sam says, !@#$% with the green button.

What sets NSWindowStyleMaskResizable to false in a Xojo app?

Turns out my SheetWindow had Window.Resizeable = False. On 10.12 this doesn’t seem to matter, but on 10.13 this does.

I set it to true: now when I show the sheet within the other window, the parent window no longer jumps up. However, the sheet appears to be sized to leave room for the dock. Also, if I put the dock on the Left side of the screen, then the window does jump to the right still.

I don’t see either of these behaviors in 10.12.

I want the sheet window to be the same size as the parent window, and I setting .FullScreen=True seemed an easy way to do it. I’ve taken that code out, and instead are just setting the SheetWindow.Width and Height to match the parent window: I see no change in behavior, however.

For those of you that are testing, be sure to test in 10.13 with the Dock on the Bottom and on the Left of the screen.

If the sheet window completely covers the parent window anyway, then why not use a separate window and hide the parent until it is closed?

Actually, it’s at 70% translucency so that wouldn’t work the way I want it.

I’m still digging into this, as there is something weird - my giant complicated project shows the bug, naturally, but simple test projects don’t, so I must be missing something.

Ok, was able to reproduce it in a simple test project.

See <https://xojo.com/issue/49647>

It only happens:

  • on 10.13
  • on Screen(0)
  • when the Dock is on the Left

I’d be curious if anyone can reproduce this using my test project?

Yep. One monitor only. Xojo 2017r1. Looks really weird.

Why not use a canvas as sheet? Or if you have MBS an overlay window?

Oh, I’m sure there are 1000 other ways it could be done, but the way I it’s currently designed has worked fine from 10.9 through 10.12, so I’d prefer not to have to refactor my app if possible.

I’ll submit this to bugreport.apple.com as well.