From 9c06c91b524aab0affc7216ab8667111146fc646 Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 5 Dec 2021 13:23:58 +0100 Subject: [PATCH 1/7] fix creating sub UTF8 string if it contains any multi byte character --- vstgui/lib/controls/ctextlabel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vstgui/lib/controls/ctextlabel.cpp b/vstgui/lib/controls/ctextlabel.cpp index ec6908f02..2a3659e3b 100644 --- a/vstgui/lib/controls/ctextlabel.cpp +++ b/vstgui/lib/controls/ctextlabel.cpp @@ -380,7 +380,8 @@ void CMultiLineTextLabel::calculateWrapLine (CDrawContext* context, lastSeparator = ++pos; if (pos == element.first.end ()) break; - UTF8String tmp ({start.base (), ++(pos.base ())}); + auto tmpEnd = pos; + UTF8String tmp ({start.base (), (++tmpEnd).base ()}); auto width = fontPainter->getStringWidth (context, tmp.getPlatformString ()); if (width > maxWidth) { From 0be05299cf030e9b954f188de4c8aa25d810de5b Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 24 Oct 2021 18:51:33 +0200 Subject: [PATCH 2/7] fix warning when macOS deployment target is higher than 10.11 --- vstgui/tests/unittest/lib/platform_helper_mac.mm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vstgui/tests/unittest/lib/platform_helper_mac.mm b/vstgui/tests/unittest/lib/platform_helper_mac.mm index 7433b8a48..5e1e812fe 100644 --- a/vstgui/tests/unittest/lib/platform_helper_mac.mm +++ b/vstgui/tests/unittest/lib/platform_helper_mac.mm @@ -14,7 +14,16 @@ MacParentHandle () { - window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 100, 100) styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO]; + NSWindowStyleMask style; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 + style = NSWindowStyleMaskTitled; +#else + style = NSTitledWindowMask; +#endif + window = [[NSWindow alloc] initWithContentRect:NSMakeRect (0, 0, 100, 100) + styleMask:style + backing:NSBackingStoreBuffered + defer:NO]; } ~MacParentHandle () override From 52d799fcc72d9c9b1d9fef07882a05ed703a2243 Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 24 Oct 2021 18:42:40 +0200 Subject: [PATCH 3/7] replace deprecated CTGetCoreTextVersion with @available --- vstgui/lib/platform/mac/cfontmac.mm | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/vstgui/lib/platform/mac/cfontmac.mm b/vstgui/lib/platform/mac/cfontmac.mm index 3a1553a08..0d8f0757f 100644 --- a/vstgui/lib/platform/mac/cfontmac.mm +++ b/vstgui/lib/platform/mac/cfontmac.mm @@ -103,23 +103,6 @@ void getUrlsForType (CFStringRef fontType, CFMutableArrayRef& array) CFMutableArrayRef fontUrls; }; -//----------------------------------------------------------------------------- -struct CTVersionCheck -{ - CTVersionCheck () - { - version = CTGetCoreTextVersion (); - } - uint32_t version; -}; - -//----------------------------------------------------------------------------- -static uint32_t getCTVersion () -{ - static CTVersionCheck gInstance; - return gInstance.version; -} - //----------------------------------------------------------------------------- bool CoreTextFont::getAllFontFamilies (const FontFamilyCallback& callback) noexcept { @@ -177,7 +160,7 @@ static CTFontRef CoreTextCreateTraitsVariant (CTFontRef fontRef, CTFontSymbolicT CFStringRef fontNameRef = fromUTF8String (name); if (fontNameRef) { - if (getCTVersion () >= 0x00060000) + if (@available (macOS 10.10, *)) { CFMutableDictionaryRef attributes = CFDictionaryCreateMutable (kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFDictionaryAddValue (attributes, kCTFontFamilyNameAttribute, fontNameRef); From af83c32e0ef34a68d1bfb709ed95e64919922529 Mon Sep 17 00:00:00 2001 From: scheffle Date: Tue, 12 Oct 2021 19:23:11 +0200 Subject: [PATCH 4/7] make sure all control listeners will be notified about control changes in the vst3editor this fixes the issue that a UIViewSwitchContainer did not switch its view when the parameter was changed from the host side (via automation or state loading) --- vstgui/plugin-bindings/vst3editor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vstgui/plugin-bindings/vst3editor.cpp b/vstgui/plugin-bindings/vst3editor.cpp index e3fc3daf9..23a1d81b9 100644 --- a/vstgui/plugin-bindings/vst3editor.cpp +++ b/vstgui/plugin-bindings/vst3editor.cpp @@ -325,6 +325,7 @@ class ParameterChangeListener : public Steinberg::FObject } else c->setValueNormalized ((float)value); + c->valueChanged (); } c->invalid (); } @@ -627,6 +628,8 @@ ParameterChangeListener* VST3Editor::getParameterChangeListener (int32_t tag) co void VST3Editor::valueChanged (CControl* pControl) { using namespace Steinberg; + if (!pControl->isEditing ()) + return; ParameterChangeListener* pcl = getParameterChangeListener (pControl->getTag ()); if (pcl) From 5e826d3bca214e70279117b8b16cf62dd1355d95 Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 3 Oct 2021 11:58:43 +0200 Subject: [PATCH 5/7] do not store UIViewSwitchContainer children --- vstgui/uidescription/uidescription.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vstgui/uidescription/uidescription.cpp b/vstgui/uidescription/uidescription.cpp index f443a222e..9adcd9a36 100644 --- a/vstgui/uidescription/uidescription.cpp +++ b/vstgui/uidescription/uidescription.cpp @@ -10,6 +10,7 @@ #include "cstream.h" #include "base64codec.h" #include "uicontentprovider.h" +#include "uiviewswitchcontainer.h" #include "icontroller.h" #include "xmlparser.h" #include "../lib/cfont.h" @@ -1591,7 +1592,7 @@ bool UIDescription::updateAttributesForView (UINode* node, CView* view, bool dee node->getAttributes ()->setAttribute (UIViewCreator::kAttrClass, factory->getViewName (view)); result = true; } - if (deep && container) + if (deep && container && dynamic_cast (container) == nullptr) { ViewIterator it (container); while (*it) From 436be599292dc1eb1401cf91f92acac4b40e49f0 Mon Sep 17 00:00:00 2001 From: scheffle Date: Tue, 7 Dec 2021 15:15:07 +0100 Subject: [PATCH 6/7] increase version patchlevel --- vstgui/lib/vstguibase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vstgui/lib/vstguibase.h b/vstgui/lib/vstguibase.h index 5433bbf2d..29c0e3819 100644 --- a/vstgui/lib/vstguibase.h +++ b/vstgui/lib/vstguibase.h @@ -13,7 +13,7 @@ //----------------------------------------------------------------------------- #define VSTGUI_VERSION_MAJOR 4 #define VSTGUI_VERSION_MINOR 10 -#define VSTGUI_VERSION_PATCHLEVEL 2 +#define VSTGUI_VERSION_PATCHLEVEL 3 //----------------------------------------------------------------------------- // Platform definitions From 7de1d70cfa9f7ead744916ae38e8f07a85b727c7 Mon Sep 17 00:00:00 2001 From: Andreas Persson Date: Sun, 11 Jul 2021 11:29:56 +0200 Subject: [PATCH 7/7] fix cairo drawing error when another frame closes If you have two CFrames open (for example two instances of the same plugin), and close one of them, the drawing in the other one starts to fail, with "the target surface has been finished" messages. The fix is simple: just remove the call to cairo_device_finish. cairo_device_destroy will call cairo_device_finish when it has decreased the refcount to zero. --- vstgui/lib/platform/linux/x11frame.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/vstgui/lib/platform/linux/x11frame.cpp b/vstgui/lib/platform/linux/x11frame.cpp index 8fe3525a4..785756ef3 100644 --- a/vstgui/lib/platform/linux/x11frame.cpp +++ b/vstgui/lib/platform/linux/x11frame.cpp @@ -121,7 +121,6 @@ struct DrawHandler ~DrawHandler () { - cairo_device_finish (device); cairo_device_destroy (device); }