Improve 1477bca76, ensure suil supports x11-in-gtk2
authorRobin Gareus <robin@gareus.org>
Mon, 28 Oct 2019 16:23:33 +0000 (17:23 +0100)
committerRobin Gareus <robin@gareus.org>
Mon, 28 Oct 2019 16:24:54 +0000 (17:24 +0100)
libs/ardour/lv2_plugin.cc

index 6b1dbde4ca4e539b7cf2e104cf91de9f3f3c4438..e5de410dd4fa550cc18d0863e9dda607a48e6e6b 100644 (file)
@@ -855,15 +855,18 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate)
                // Always prefer X11 UIs...
                LILV_FOREACH(uis, i, uis) {
                        const LilvUI* ui = lilv_uis_get(uis, i);
-                       if (lilv_ui_is_a(ui, _world.ui_X11UI)) {
-                               this_ui      = ui;
-                               this_ui_type = _world.ui_X11UI;
+                       if (lilv_ui_is_a(ui, _world.ui_X11UI) &&
+                           lilv_ui_is_supported (ui,
+                                                 suil_ui_supported,
+                                                 world.ui_GtkUI,
+                                                 &this_ui_type)) {
+                               this_ui = ui;
                                break;
                        }
                }
 #endif
-               // then anything else...
-               if (this_ui_type == NULL) {
+               // Then anything else...
+               if (this_ui == NULL) {
                        LILV_FOREACH(uis, i, uis) {
                                const LilvUI* ui = lilv_uis_get(uis, i);
                                if (lilv_ui_is_supported (ui,
@@ -876,7 +879,7 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate)
                        }
                }
                // Found one that is supported by SUIL?...
-               if (this_ui_type != NULL) {
+               if (this_ui != NULL) {
                        _impl->ui      = this_ui;
                        _impl->ui_type = this_ui_type;
                }