El Capitan: SetFullscreen(), SetResizable(), SetResizeLimits() BROKEN?


#1

I must be doing something wrong:

class MainWindow    : public DocumentWindow
    {
    public:
        MainWindow (String name)  : DocumentWindow (name,
                                                    Colours::lightgrey,
                                                    DocumentWindow::allButtons)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (new MainContentComponent(), true);
            setResizable(true, true );
            setResizeLimits(128,
                            128,
                            Desktop::getInstance().getDisplays().getMainDisplay().userArea.getWidth(),
                            Desktop::getInstance().getDisplays().getMainDisplay().userArea.getHeight() );
            centreWithSize (getWidth(), getHeight());
            setFullScreen(false);
            setVisible (true);
        }

        void closeButtonPressed() override
        {
            // This is called when the user tries to close this window. Here, we'll just
            // ask the app to quit when this happens, but you can change this to do
            // whatever you need.
            JUCEApplication::getInstance()->systemRequestedQuit();
        }
        /* Note: Be careful if you override any DocumentWindow methods - the base
           class uses a lot of them, so by overriding you might break its functionality.

           It's best to do all your work in your content component instead, but if

           you really have to override any DocumentWindow methods, make sure your

           subclass also calls the superclass's method.

        */

        void maximiseButtonPressed() override {
         
        }
       
    private:
        JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
    };

I'm trying to prevent the Maximize/FullScreen from happening and still allow the ability to resize my app.    Is this stuff broken in JUCE 4.1 and OS X 10.11.x? 

Also, if I paste code from XCode into a forum thread, it doubles the number of return/new line statements.   


#2

ok, Changing 'setUsingNativeTitleBar()' to false fixes the problem with the maximize button.    However, I still can't enable resizing for some reason.  


#3

Just wanted to add, if setUsingNativeTitleBar() is set to False, then you can override 'maximiseButtonPressed()'.  

if it's set to true, then overriding maximiseButtonPressed() does nothing and is never called.