aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/jalv.c17
-rw-r--r--src/jalv_gtk2.c3
-rw-r--r--src/jalv_internal.h3
3 files changed, 21 insertions, 2 deletions
diff --git a/src/jalv.c b/src/jalv.c
index 8deea96..d71d2b4 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -54,6 +54,7 @@
#define NS_MIDI "http://lv2plug.in/ns/ext/midi#"
#define NS_PSET "http://lv2plug.in/ns/ext/presets#"
#define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+#define NS_UI "http://lv2plug.in/ns/extensions/ui#"
#define USTR(str) ((const uint8_t*)str)
@@ -535,6 +536,22 @@ jack_session_cb(jack_session_event_t* event, void* arg)
}
#endif /* JALV_JACK_SESSION */
+bool
+jalv_ui_is_resizable(Jalv* jalv)
+{
+ const LilvNode* s = lilv_ui_get_uri(jalv->ui);
+ LilvNode* p = lilv_new_uri(jalv->world, LV2_CORE__requiredFeature);
+ LilvNode* o = lilv_new_uri(jalv->world, NS_UI "fixedSize");
+
+ LilvNodes* matches = lilv_world_find_nodes(jalv->world, s, p, o);
+
+ lilv_node_free(o);
+ lilv_node_free(p);
+ lilv_nodes_free(matches);
+
+ return matches == NULL;
+}
+
void
jalv_ui_write(SuilController controller,
uint32_t port_index,
diff --git a/src/jalv_gtk2.c b/src/jalv_gtk2.c
index 3e20398..6113caf 100644
--- a/src/jalv_gtk2.c
+++ b/src/jalv_gtk2.c
@@ -275,8 +275,7 @@ jalv_open_ui(Jalv* jalv,
gtk_container_add(GTK_CONTAINER(alignment), button);
}
- // TODO: Check UI properties for resizable
- gtk_window_set_resizable(GTK_WINDOW(window), false);
+ gtk_window_set_resizable(GTK_WINDOW(window), jalv_ui_is_resizable(jalv));
gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_widget_show_all(window);
diff --git a/src/jalv_internal.h b/src/jalv_internal.h
index 07c40b3..7c63e96 100644
--- a/src/jalv_internal.h
+++ b/src/jalv_internal.h
@@ -163,6 +163,9 @@ int
jalv_open_ui(Jalv* jalv,
SuilInstance* instance);
+bool
+jalv_ui_is_resizable(Jalv* jalv);
+
void
jalv_ui_write(SuilController controller,
uint32_t port_index,