commit d2b96431b2a5790e9d281f97e09e42ab2f90a927
parent 1162d24a197340aaab3a1dff317a6374c73ec495
Author: falkTX <falktx@falktx.com>
Date: Sun, 30 May 2021 22:55:53 +0100
Cleanup for lv2 ui resizing, no host features needed
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
4 files changed, 4 insertions(+), 35 deletions(-)
diff --git a/dgl/TopLevelWidget.hpp b/dgl/TopLevelWidget.hpp
@@ -74,16 +74,19 @@ public:
/**
Set height of this widget's window.
+ @note This will not change the widget's size right away, but be pending on OS resizing the window
*/
void setHeight(uint height);
/**
Set size of this widget's window, using @a width and @a height values.
+ @note This will not change the widget's size right away, but be pending on OS resizing the window
*/
void setSize(uint width, uint height);
/**
Set size of this widget's window.
+ @note This will not change the widget's size right away, but be pending on OS resizing the window
*/
void setSize(const Size<uint>& size);
diff --git a/dgl/src/pugl.cpp b/dgl/src/pugl.cpp
@@ -291,23 +291,6 @@ PuglStatus puglSetWindowSize(PuglView* const view, const uint width, const uint
if (! XResizeWindow(display, view->impl->win, width, height))
return PUGL_UNKNOWN_ERROR;
-#if 0
- // custom handling for embed non-resizable windows
- if (view->parent != 0 && ! view->hints[PUGL_RESIZABLE])
- {
- XSizeHints sizeHints = {};
- sizeHints.flags = PSize | PBaseSize | PMinSize | PMaxSize;
- sizeHints.width = static_cast<int>(width);
- sizeHints.height = static_cast<int>(height);
- sizeHints.base_width = width;
- sizeHints.base_height = height;
- sizeHints.min_width = width;
- sizeHints.min_height = height;
- sizeHints.max_width = width;
- sizeHints.max_height = height;
- XSetNormalHints(display, view->impl->win, &sizeHints);
- }
-#endif
if (const PuglStatus status = updateSizeHints(view))
return status;
diff --git a/distrho/src/DistrhoPluginLV2export.cpp b/distrho/src/DistrhoPluginLV2export.cpp
@@ -131,7 +131,6 @@ static const char* const lv2ManifestUiExtensionData[] =
"opts:interface",
"ui:idleInterface",
"ui:showInterface",
- "ui:resize",
#if DISTRHO_PLUGIN_WANT_PROGRAMS
LV2_PROGRAMS__UIInterface,
#endif
@@ -145,7 +144,6 @@ static const char* const lv2ManifestUiOptionalFeatures[] =
"ui:noUserResize",
# endif
"ui:parent",
- "ui:resize",
"ui:touch",
#endif
#if DISTRHO_PLUGIN_WANT_STATEFILES
diff --git a/distrho/src/DistrhoUILV2.cpp b/distrho/src/DistrhoUILV2.cpp
@@ -81,7 +81,7 @@ public:
setParameterCallback,
setStateCallback,
sendNoteCallback,
- setSizeCallback,
+ nullptr, // resize is very messy, hosts can do it without extensions
fileRequestCallback,
bundlePath,
dspPtr,
@@ -90,7 +90,6 @@ public:
fgColor),
fUridMap(uridMap),
fUiRequestValue(getLv2Feature<LV2UI_Request_Value>(features, LV2_UI__requestValue)),
- fUiResize(getLv2Feature<LV2UI_Resize>(features, LV2_UI__resize)),
fUiTouch(getLv2Feature<LV2UI_Touch>(features, LV2_UI__touch)),
fController(controller),
fWriteFunction(writeFunc),
@@ -322,14 +321,6 @@ protected:
}
#endif
- void setSize(const uint width, const uint height)
- {
- // report window size change to host.
- // at the moment no lv2 hosts automatically adapt to child window size changes, so this is still needed
- if (fUiResize != nullptr && ! fWinIdWasNull)
- fUiResize->ui_resize(fUiResize->handle, width, height);
- }
-
bool fileRequest(const char* const key)
{
d_stdout("UI file request %s %p", key, fUiRequestValue);
@@ -355,7 +346,6 @@ private:
// LV2 features
const LV2_URID_Map* const fUridMap;
const LV2UI_Request_Value* const fUiRequestValue;
- const LV2UI_Resize* const fUiResize;
const LV2UI_Touch* const fUiTouch;
// LV2 UI stuff
@@ -423,11 +413,6 @@ private:
}
#endif
- static void setSizeCallback(void* ptr, uint width, uint height)
- {
- uiPtr->setSize(width, height);
- }
-
static bool fileRequestCallback(void* ptr, const char* key)
{
return uiPtr->fileRequest(key);