EDIT: VST HOST MAC effEditClose not being called on 32bit cocoa plugins


#1

EDIT: see below

 

I want to close all open popup menus from a plugin, when the plugin window gets closed, currently they only will closed when the editor is deleted.


#2

PopupMenu::dismissAllActiveMenus


#3

yes i do that (the wrapper also do it), this was not my question

arghh to complicated to explain it all,  getting crazy right now

But (for example) when you close the plugin-window in a older version of juce plugin-host (in the meantime you changed the behavior of it) an open plugin-window-popup stays open ( there can be many reasons for it, maybe because the editor class doesn't gets deleted and only the window gets closed ) ( the plugin-has the latest wrapper-code.)

Because parts of the plugin-hosting code is specific to the Juce Plugin Host Demo, i had to fork this code and baking my own solution.

Things like PluginWindow (GraphEditorPanel.cpp) etc, should be part of the modul-repository, so that  anybody gets automatically new innovations.

 


#4

Can that be the reason for my trouble, i only build a 32bit version of my host, and then   JUCE_SUPPORT_CARBON is 1, and it seems effEditClose doesn't gets called ?





  void closePluginWindow()

    {

        if (isOpen)

        {

           #if ! (JUCE_MAC && JUCE_SUPPORT_CARBON)

            JUCE_VST_LOG ("Closing VST UI: " + plugin.getName());

            isOpen = false;


            dispatch (effEditClose, 0, 0, 0, 0);

            stopTimer();


           #if JUCE_WINDOWS

            #pragma warning (push)

            #pragma warning (disable: 4244)

            if (pluginHWND != 0 && IsWindow (pluginHWND))

                SetWindowLongPtr (pluginHWND, GWLP_WNDPROC, (LONG_PTR) originalWndProc);

            #pragma warning (pop)


            pluginHWND = 0;

           #elif JUCE_LINUX

            pluginWindow = 0;

            pluginProc = 0;

           #endif

           #endif

        }

    }

#5

It should get called at line 2541 instead


#6

But if its a 32bit cocoa plugin, its not called. 

closePluginWindow() will call nothing because of the if-directive, and the cocoa-wrapper is just a AutoResizingNSViewComponentWithParent, with does not call any implicit effEditClose

 


 


#7

bump, it seems 32bit cocoa plugins don't recieve effEditClose when JUCE_SUPPORT_CARBON == 1


#8

Ok.. looking at this, I think that I should just remove that #if and let that bit of code be run on all platforms. But I'm a bit worried about why I would have added it in the first place - hopefully it was just an oversight and not because of some subtle problem that causes failure in some obscure situation..


#9

well the current behavior causes subtle a problem, popups don't get closed when the editor is closed and whats even more bad, they don't get destroyed when the editor is deleted (32bit cocoa)

 


#10

I already changed this yesterday - let me know if you see any problems with it.


#11

um, seems to be the old version? (last change 2 months ago)

 

https://github.com/julianstorer/JUCE/blob/master/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp


#12

Sorry - I must have forgotten to push. It's there now.