Browse Source

carla-plugin: force qt to use xcb backend if going to embed UI

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
3c27fbdd3a
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 30 additions and 15 deletions
  1. +30
    -15
      source/frontend/carla-plugin

+ 30
- 15
source/frontend/carla-plugin View File

@@ -578,17 +578,17 @@ class CarlaEmbedW(QEmbedWidget):

if __name__ == '__main__':
# -------------------------------------------------------------
# App initialization

app = CarlaApplication("Carla2-Plugin")
# Get details regarding target usage

# -------------------------------------------------------------
# Set-up custom signal handling
try:
winId = int(os.getenv("CARLA_PLUGIN_EMBED_WINID"))
except:
winId = 0

setUpSignals()
usingEmbed = bool(LINUX and winId != 0)

# -------------------------------------------------------------
# Init host backend
# Init host backend (part 1)

isPatchbay = sys.argv[0].rsplit(os.path.sep)[-1].lower().replace(".exe","") == "carla-plugin-patchbay"

@@ -596,19 +596,34 @@ if __name__ == '__main__':
host.processMode = ENGINE_PROCESS_MODE_PATCHBAY if isPatchbay else ENGINE_PROCESS_MODE_CONTINUOUS_RACK
host.processModeForced = True
host.nextProcessMode = host.processMode
loadHostSettings(host)

# -------------------------------------------------------------
# Create GUI

try:
winId = int(os.getenv("CARLA_PLUGIN_EMBED_WINID"))
except:
winId = 0
# Set-up environment

gCarla.utils.setenv("CARLA_PLUGIN_EMBED_WINID", "0")

if LINUX and winId != 0:
if usingEmbed:
gCarla.utils.setenv("QT_QPA_PLATFORM", "xcb")

# -------------------------------------------------------------
# App initialization

app = CarlaApplication("Carla2-Plugin")

# -------------------------------------------------------------
# Set-up custom signal handling

setUpSignals()

# -------------------------------------------------------------
# Init host backend (part 2)

loadHostSettings(host)

# -------------------------------------------------------------
# Create GUI

if usingEmbed:
gui = CarlaEmbedW(host, winId, isPatchbay)
else:
gui = CarlaMiniW(host, isPatchbay)


Loading…
Cancel
Save