Native child windows

We have just pushed some changes that allow windows created from your app or plug-in to bind to a parent window.

This uses a similar convention to that already implemented for things like pop-up menus, where you can set an “associated” component.

Windows with an associated parent will do the following:

  1. Move with the parent
  2. Minimise and restore with the parent
  3. Not appear on the taskbar

No windows from different apps can be ordered between a child and an associated parent.

We have updated JUCE’s built-in widgets, like PopupMenu, TooltipWindow and AlertWindow, to use the new mechanism. You should see improved behaviour in cases where you have a temporary window, like a popup, open in a plug-in, and the plug-in window is moved, and other similar situations.

Pass

DesktopWindowOptions().withStyleFlags (...).withAssociatedComponent (c)

to the new addToDesktop overload, or call setAssociatedComponent on a TopLevelWindow.

createNewPeer now takes a DesktopWindowOptions. You may need to make some changes to your code if you have customised addToDesktop. See the breaking changes document here:

3 Likes