Browse Source

Carefully handle lv2 ui child window, fixes crash with some x42 uis

Fixes #1128

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.3.0-RC1
falkTX 4 years ago
parent
commit
325d436922
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 15 additions and 6 deletions
  1. +15
    -6
      source/utils/CarlaPluginUI.cpp

+ 15
- 6
source/utils/CarlaPluginUI.cpp View File

@@ -229,16 +229,25 @@ public:

if (fChildWindow != 0)
{
XSizeHints sizeHints;
carla_zeroStruct(sizeHints);

if (!fChildWindowConfigured && XGetNormalHints(fDisplay, fChildWindow, &sizeHints))
if (! fChildWindowConfigured)
{
gErrorTriggered = false;
const XErrorHandler oldErrorHandler = XSetErrorHandler(temporaryErrorHandler);

XSizeHints sizeHints;
carla_zeroStruct(sizeHints);

if (XGetNormalHints(fDisplay, fChildWindow, &sizeHints) && !gErrorTriggered)
XSetNormalHints(fDisplay, fHostWindow, &sizeHints);
else
fChildWindow = 0;

fChildWindowConfigured = true;
XSetNormalHints(fDisplay, fHostWindow, &sizeHints);
XSetErrorHandler(oldErrorHandler);
}

XResizeWindow(fDisplay, fChildWindow, width, height);
if (fChildWindow != 0)
XResizeWindow(fDisplay, fChildWindow, width, height);
}

fCallback->handlePluginUIResized(width, height);


Loading…
Cancel
Save