Actual small change is to have child-NSWindow to use '[myWindow orderWindow: NSWindowAbove relativeTo:..' instead of 'orderFront' in creation and use the simple 'orderFront' to set a top-level NSWindow visible.
Adding comment why we can't use 'orderOut' on child-NSWindow setting it invisible, this is due to OSX 10.7 changes and testing detaching the child-window from its parent causes havoc w/ SWT at least. Hence we only issue 'mWin orderWindow: NSWindowOut relativeTo:..]' and the result is having the child-NSWindow below the application.
This in turn will make it visible again when moving the application around, as this child-NSWindow will no more follow the position.
Suggestion is to have this 'fake invisible' child-NSWindow to be moved out of the overal viewport (all screens).
Bug 1421: NEWT OSX Invisible: Fix orderOut0 re commit d92dc518eb891f2d125a8136efd6ed603d74a6e9
We also cannot use 'mWin orderWindow: NSWindowOut relativeTo:..]' as it also removes the child-NSWindow from its parent like 'orderOut'. Hence only use 'orderBack' to keep the relationship inplace.
Fake invisible child window is in progress, i.e. moving it out of the overal viewport (all screens).
'Fake invisible child window' is implemented by simply moving the window out of sight (viewport).
- orderOut0 needs to use '[mWin orderWindow: NSWindowBelow relativeTo:..' parentWindow instead of '[mWin orderBack:..', otherwise the whole parent application gets invisible w/ SWT ;-)
- NewtNSWindow may also needs to use parent's Screen instance if moved offscreen, as the own Screen is invalid (zero size) in this case.
- WindowDriver: Adding special treatment for 'Fake invisible child window' (tagged as such): -- reconfigureWindowImpl: setWindowClientTopLeftPointAndSize0(..) will be called using the viewport's max position -> out of sight. -- screenPositionChanged: ignore the 'new' position -- sizeChanged: ignore the 'new' size
This sensitive NEWT change set shall benefit other toolkits being used as parentWindow besides SWT, as this behavior is the same across MacOS.
Ensure it stays out of sight by moving it to 2x width/height of viewport. Otherwise one could see the child window moving from lower-right to upper-left ;-)
TestGLCanvasSWTNewtCanvasSWTPosInTabs: Only use 1 Animator to easy example code
Otherwise one would want to pause the Animator instance for the hidden GLWindow, otherwise such animator with zero visible drawables will become a CPU hog.
Well, this seems to exist to allow 96 dpi fixed layout to 'look' OK on high-dpi screens. However, you get in trouble if you layout high-dpi aware, i.e. using percentages etc.
There is one exception: If DPIUtil.useCairoAutoScale() is true, scalingFactor is 1f and hence the scaling emulation dropped.