Hi I’m using this class I done:
class EditorWindow : public DocumentWindow
{
public:
EditorWindow(String name, NodeGraph_PluginAudioProcessor& processor)
: DocumentWindow (name, Colours::black, DocumentWindow::allButtons), owner(processor)
{
NodeGraph_PluginAudioProcessorEditor* activeWindowEditor = owner.getActiveWindowEditor();
activeWindowEditor = new NodeGraph_PluginAudioProcessorEditor{owner};
setContentOwned (owner.getActiveWindowEditor(), true);
if (owner.windowEditorBounds.isEmpty())
centreWithSize (DEFAULT_SIZE_W, DEFAULT_SIZE_H);
else
restoreWindowStateFromString(owner.windowEditorBounds);
setUsingNativeTitleBar (true);
setResizable (true, true);
setVisible (true);
}
~EditorWindow()
{
owner.windowEditorBounds = getWindowStateAsString();
owner.interprocessMixerConnector->sendMessageToMixer(ayra::InterprocessMessageType::openCloseEditor, var{false}, var{});
}
void closeButtonPressed() override
{
owner.activeWindowEditor.deleteAndZero();
owner.editorWindow.reset();
}
private:
NodeGraph_PluginAudioProcessor& owner;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (EditorWindow)
};
All works perfectly if my window is open and close in the main display, if for example I bring it in another display and I close it on restoreWindowStateFromString(owner.windowEditorBounds); all bounds are restored correctly but IN THE MAIN DISPLAY not in the second (where the Window was when ** owner.windowEditorBounds = getWindowStateAsString();** is called).
NB: in owner the var windowEditorBounds is never used or changed…
where’s the problem?
