diff --git a/distrho/DistrhoUI.hpp b/distrho/DistrhoUI.hpp index 811d83ef..8dda7fae 100644 --- a/distrho/DistrhoUI.hpp +++ b/distrho/DistrhoUI.hpp @@ -303,17 +303,26 @@ protected: */ virtual void uiFileBrowserSelected(const char* filename); # endif +#endif // !DISTRHO_PLUGIN_HAS_EXTERNAL_UI /* -------------------------------------------------------------------------------------------------------- * UI Resize Handling, internal */ +#if DISTRHO_PLUGIN_HAS_EXTERNAL_UI + /** + External Window resize function, called when the window is resized. + This is overriden here so the host knows when the UI is resized by you. + @see ExternalWindow::sizeChanged(uint,uint) + */ + void sizeChanged(uint width, uint height) override; +#else /** - OpenGL widget resize function, called when the widget is resized. + Widget resize function, called when the widget is resized. This is overriden here so the host knows when the UI is resized by you. @see Widget::onResize(const ResizeEvent&) */ void onResize(const ResizeEvent& ev) override; -#endif // !DISTRHO_PLUGIN_HAS_EXTERNAL_UI +#endif // ------------------------------------------------------------------------------------------------------- diff --git a/distrho/src/DistrhoUI.cpp b/distrho/src/DistrhoUI.cpp index 2dfb1d63..752b9cda 100644 --- a/distrho/src/DistrhoUI.cpp +++ b/distrho/src/DistrhoUI.cpp @@ -209,10 +209,19 @@ void UI::uiFileBrowserSelected(const char*) { } # endif +#endif // !DISTRHO_PLUGIN_HAS_EXTERNAL_UI /* ------------------------------------------------------------------------------------------------------------ * UI Resize Handling, internal */ +#if DISTRHO_PLUGIN_HAS_EXTERNAL_UI +void UI::sizeChanged(const uint width, const uint height) +{ + UIWidget::sizeChanged(width, height); + + uiData->setSizeCallback(width, height); +} +#else void UI::onResize(const ResizeEvent& ev) { UIWidget::onResize(ev); @@ -221,7 +230,7 @@ void UI::onResize(const ResizeEvent& ev) const uint height = ev.size.getHeight(); uiData->setSizeCallback(width, height); } -#endif // !DISTRHO_PLUGIN_HAS_EXTERNAL_UI +#endif // -----------------------------------------------------------------------------------------------------------