Browse Source

Cleanup for lv2 ui resizing, no host features needed

Signed-off-by: falkTX <falktx@falktx.com>
pull/282/head
falkTX 4 years ago
parent
commit
d2b96431b2
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 4 additions and 35 deletions
  1. +3
    -0
      dgl/TopLevelWidget.hpp
  2. +0
    -17
      dgl/src/pugl.cpp
  3. +0
    -2
      distrho/src/DistrhoPluginLV2export.cpp
  4. +1
    -16
      distrho/src/DistrhoUILV2.cpp

+ 3
- 0
dgl/TopLevelWidget.hpp View File

@@ -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);



+ 0
- 17
dgl/src/pugl.cpp View File

@@ -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;



+ 0
- 2
distrho/src/DistrhoPluginLV2export.cpp View File

@@ -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


+ 1
- 16
distrho/src/DistrhoUILV2.cpp View File

@@ -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);


Loading…
Cancel
Save