From c00ff655bb644f1508102387b4640c33d73c5724 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 22 Aug 2021 23:44:52 +0100 Subject: [PATCH] Use a black background; Allow VST2 embed external UIs Signed-off-by: falkTX --- distrho/src/DistrhoPluginVST2.cpp | 2 +- examples/EmbedExternalUI/EmbedExternalExampleUI.cpp | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/distrho/src/DistrhoPluginVST2.cpp b/distrho/src/DistrhoPluginVST2.cpp index 74a655c5..b46f7ceb 100644 --- a/distrho/src/DistrhoPluginVST2.cpp +++ b/distrho/src/DistrhoPluginVST2.cpp @@ -22,7 +22,7 @@ # define DISTRHO_PLUGIN_HAS_UI 0 #endif -#if DISTRHO_PLUGIN_HAS_UI && ! defined(HAVE_DGL) +#if DISTRHO_PLUGIN_HAS_UI && ! defined(HAVE_DGL) && ! defined (DISTRHO_PLUGIN_HAS_EXTERNAL_UI) # undef DISTRHO_PLUGIN_HAS_UI # define DISTRHO_PLUGIN_HAS_UI 0 #endif diff --git a/examples/EmbedExternalUI/EmbedExternalExampleUI.cpp b/examples/EmbedExternalUI/EmbedExternalExampleUI.cpp index 1b5f1cf5..b1ae6554 100644 --- a/examples/EmbedExternalUI/EmbedExternalExampleUI.cpp +++ b/examples/EmbedExternalUI/EmbedExternalExampleUI.cpp @@ -59,13 +59,7 @@ public: const ::Window root = RootWindow(fDisplay, screen); const ::Window parent = isEmbed() ? (::Window)getParentWindowHandle() : root; - XSetWindowAttributes attr = {}; - attr.event_mask = KeyPressMask|KeyReleaseMask; - - fWindow = XCreateWindow(fDisplay, parent, - 0, 0, getWidth(), getHeight(), - 0, DefaultDepth(fDisplay, screen), InputOutput, DefaultVisual(fDisplay, screen), - CWColormap | CWEventMask, &attr); + fWindow = XCreateSimpleWindow(fDisplay, parent, 0, 0, getWidth(), getHeight(), 0, 0, 0); DISTRHO_SAFE_ASSERT_RETURN(fWindow != 0,); XSizeHints sizeHints = {}; @@ -73,7 +67,6 @@ public: sizeHints.min_width = getWidth(); sizeHints.min_height = getHeight(); XSetNormalHints(fDisplay, fWindow, &sizeHints); - XStoreName(fDisplay, fWindow, getTitle()); if (parent == root)