DocumentWindows In Plugins

I’ve been attempting to add a second window to my plugin by using a DocumentWindow inside of my plugin.

It appears to be working well although there are some slight hiccups like needing to always set the window on top and it stealing keystrokes from the host.

Anyone have experiences on some best practice tips while doing this?

I think the best practice is to not do it at all.

Plugins don’t create their own window, the host creates it and tells the plugin to draw itself within it. Creating extra windows is always going to be problematic.

If you really really want a second window, one workaround might be to simply add a Component to the desktop, similar to how popup menus work, and have it draw its own title bar.

Yeah I agree that it’s not ideal but there are plugin which have pulled it off and I’ve gotten numerous request to break some panels out into multiple windows.

That’s an interesting idea though, I hadn’t tried adding a component directly to the desktop without using a toplevelwindow class I didn’t know that’s possible.

I’ll report back here how that behaves vs the typical document window approach

Alright I’ve got pretty desirable results with a DocumentWindow. The trick is to set the window to not get key focus, but then add the components you want to have hover actions etc inside of the component as mouseListeners against the entire desktop