diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp index 6156b09037..300373be1f 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp @@ -90,12 +90,6 @@ int ResizableWindow::getDesktopWindowStyleFlags() const return styleFlags; } -void ResizableWindow::addToDesktop() -{ - Component::addToDesktop (ResizableWindow::getDesktopWindowStyleFlags()); - setDropShadowEnabled (isDropShadowEnabled()); // force an update to clear away any fake shadows if necessary. -} - //============================================================================== void ResizableWindow::clearContentComponent() { diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.h b/modules/juce_gui_basics/windows/juce_ResizableWindow.h index e4464119b9..242062a20b 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.h +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.h @@ -189,9 +189,6 @@ public: */ void setMinimised (bool shouldMinimise); - /** Adds the window to the desktop using the default flags. */ - void addToDesktop(); - //============================================================================== /** Returns a string which encodes the window's current size and position. diff --git a/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp b/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp index fc2ad4cc61..8cba8b31e9 100644 --- a/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp @@ -238,11 +238,11 @@ void TopLevelWindow::setDropShadowEnabled (const bool useShadow) } } -void TopLevelWindow::setUsingNativeTitleBar (const bool useNativeTitleBar_) +void TopLevelWindow::setUsingNativeTitleBar (const bool shouldUseNativeTitleBar) { - if (useNativeTitleBar != useNativeTitleBar_) + if (useNativeTitleBar != shouldUseNativeTitleBar) { - useNativeTitleBar = useNativeTitleBar_; + useNativeTitleBar = shouldUseNativeTitleBar; recreateDesktopWindow(); sendLookAndFeelChange(); } @@ -257,6 +257,13 @@ void TopLevelWindow::recreateDesktopWindow() } } +void TopLevelWindow::addToDesktop() +{ + shadower = nullptr; + Component::addToDesktop (getDesktopWindowStyleFlags()); + setDropShadowEnabled (isDropShadowEnabled()); // force an update to clear away any fake shadows if necessary. +} + void TopLevelWindow::addToDesktop (int windowStyleFlags, void* nativeWindowToAttachTo) { /* It's not recommended to change the desktop window flags directly for a TopLevelWindow, @@ -330,7 +337,7 @@ TopLevelWindow* TopLevelWindow::getActiveTopLevelWindow() noexcept int numTWLParents = 0; for (const Component* c = tlw->getParentComponent(); c != nullptr; c = c->getParentComponent()) - if (dynamic_cast (c) != nullptr) + if (dynamic_cast (c) != nullptr) ++numTWLParents; if (bestNumTWLParents < numTWLParents) diff --git a/modules/juce_gui_basics/windows/juce_TopLevelWindow.h b/modules/juce_gui_basics/windows/juce_TopLevelWindow.h index 02e7bcb899..790e718bf1 100644 --- a/modules/juce_gui_basics/windows/juce_TopLevelWindow.h +++ b/modules/juce_gui_basics/windows/juce_TopLevelWindow.h @@ -122,6 +122,8 @@ public: */ static TopLevelWindow* getActiveTopLevelWindow() noexcept; + /** Adds the window to the desktop using the default flags. */ + void addToDesktop(); //============================================================================== /** @internal */ @@ -149,6 +151,7 @@ protected: private: friend class TopLevelWindowManager; + friend class ResizableWindow; bool useDropShadow, useNativeTitleBar, isCurrentlyActive; ScopedPointer shadower;