From 785fd06e12def2baf54b88ec0b28e7451fb8a2d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 29 Sep 2022 14:22:56 +0200 Subject: [PATCH 1/2] use horizontal in VU-Meter wrapper widgets --- res/skins/Shade/auxiliary.xml | 1 + res/skins/Shade/microphone.xml | 1 + res/skins/Shade/mixer_panel.xml | 21 +++++++++++++++++++++ res/skins/Shade/preview_deck.xml | 1 + res/skins/Shade/sampler.xml | 1 + 5 files changed, 25 insertions(+) diff --git a/res/skins/Shade/auxiliary.xml b/res/skins/Shade/auxiliary.xml index c4fa6017d92..7a5e3be3c52 100644 --- a/res/skins/Shade/auxiliary.xml +++ b/res/skins/Shade/auxiliary.xml @@ -27,6 +27,7 @@ 99,14 5f,35f + horizontal auxiliary_VuMeter diff --git a/res/skins/Shade/microphone.xml b/res/skins/Shade/microphone.xml index 1e572cef83e..3a51a598b74 100644 --- a/res/skins/Shade/microphone.xml +++ b/res/skins/Shade/microphone.xml @@ -28,6 +28,7 @@ 82,14 5f,35f + horizontal microphone_VuMeter diff --git a/res/skins/Shade/mixer_panel.xml b/res/skins/Shade/mixer_panel.xml index 37343e38add..377b5d818f1 100644 --- a/res/skins/Shade/mixer_panel.xml +++ b/res/skins/Shade/mixer_panel.xml @@ -507,6 +507,7 @@ 113,28 26f,1f + horizontal @@ -798,6 +799,7 @@ 107,76 5f,81f + horizontal channel_VuMeter @@ -808,6 +810,10 @@ 500 50 2 + 1 + vinyl_spinny_background.png + vinyl_spinny_foreground.png + vinyl_spinny_foreground_ghost.png [Channel1],VuMeter @@ -817,6 +823,7 @@ 143,76 5f,81f + horizontal channel_VuMeter @@ -827,6 +834,10 @@ 500 50 2 + 1 + vinyl_spinny_background.png + vinyl_spinny_foreground.png + vinyl_spinny_foreground_ghost.png [Channel2],VuMeter @@ -836,6 +847,7 @@ 122,76 5f,81f + horizontal master_VuMeterL @@ -845,6 +857,10 @@ 500 50 2 + 1 + vinyl_spinny_background.png + vinyl_spinny_foreground.png + vinyl_spinny_foreground_ghost.png [Master],VuMeterL @@ -854,6 +870,7 @@ 128,76 5f,81f + horizontal master_VuMeterR @@ -863,6 +880,10 @@ 500 50 2 + 1 + vinyl_spinny_background.png + vinyl_spinny_foreground.png + vinyl_spinny_foreground_ghost.png [Master],VuMeterR diff --git a/res/skins/Shade/preview_deck.xml b/res/skins/Shade/preview_deck.xml index 9a0d5280461..0449fe8a114 100644 --- a/res/skins/Shade/preview_deck.xml +++ b/res/skins/Shade/preview_deck.xml @@ -218,6 +218,7 @@ 2,11 5f,41f + horizontal sampler_VuMeter diff --git a/res/skins/Shade/sampler.xml b/res/skins/Shade/sampler.xml index 0cd290d5816..2244543a5af 100644 --- a/res/skins/Shade/sampler.xml +++ b/res/skins/Shade/sampler.xml @@ -386,6 +386,7 @@ 3,24 + horizontal sampler_VuMeter From c9af1e05b1a41aef568f76990650158e36bc2505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 29 Sep 2022 14:59:50 +0200 Subject: [PATCH 2/2] Fix sefgault cause by a concurrent creation of platform windows. --- src/skin/legacy/legacyskinparser.cpp | 38 +++++++++++++++++++--------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/skin/legacy/legacyskinparser.cpp b/src/skin/legacy/legacyskinparser.cpp index 65b791d7b2d..f794b2b41eb 100644 --- a/src/skin/legacy/legacyskinparser.cpp +++ b/src/skin/legacy/legacyskinparser.cpp @@ -1269,22 +1269,29 @@ QWidget* LegacySkinParser::parseSpinny(const QDomElement& node) { SKIN_WARNING(node, *m_pContext) << "No player found for group:" << group; return nullptr; } - WSpinny* spinny = new WSpinny(m_pParent, group, m_pConfig, m_pVCManager, pPlayer); - commonWidgetSetup(node, spinny); + // Note: For some reasons we need to create the widget without a parent to avoid to + // create two platform windows in QWidget::create() for this widget. + // This happens, because the QWidget::create() of a parent() will populate all children + // with platform windows q_createNativeChildrenAndSetParent() while another window is already + // under construction. The ID for the first window is not cleared and leads to a segfault + // during on shutdown + WSpinny* pSpinny = new WSpinny(nullptr, group, m_pConfig, m_pVCManager, pPlayer); + pSpinny->setParent(m_pParent); + commonWidgetSetup(node, pSpinny); connect(waveformWidgetFactory, &WaveformWidgetFactory::renderSpinnies, - spinny, + pSpinny, &WSpinny::render); - connect(waveformWidgetFactory, &WaveformWidgetFactory::swapSpinnies, spinny, &WSpinny::swap); - connect(spinny, &WSpinny::trackDropped, m_pPlayerManager, &PlayerManager::slotLoadToPlayer); - connect(spinny, &WSpinny::cloneDeck, m_pPlayerManager, &PlayerManager::slotCloneDeck); + connect(waveformWidgetFactory, &WaveformWidgetFactory::swapSpinnies, pSpinny, &WSpinny::swap); + connect(pSpinny, &WSpinny::trackDropped, m_pPlayerManager, &PlayerManager::slotLoadToPlayer); + connect(pSpinny, &WSpinny::cloneDeck, m_pPlayerManager, &PlayerManager::slotCloneDeck); - spinny->setup(node, *m_pContext); - spinny->installEventFilter(m_pKeyboard); - spinny->installEventFilter(m_pControllerManager->getControllerLearningEventFilter()); - spinny->Init(); - return spinny; + pSpinny->setup(node, *m_pContext); + pSpinny->installEventFilter(m_pKeyboard); + pSpinny->installEventFilter(m_pControllerManager->getControllerLearningEventFilter()); + pSpinny->Init(); + return pSpinny; } QWidget* LegacySkinParser::parseVuMeter(const QDomElement& node) { @@ -1312,7 +1319,14 @@ QWidget* LegacySkinParser::parseVuMeter(const QDomElement& node) { dummy->setText(tr("No OpenGL\nsupport.")); return dummy; } - WVuMeterGL* pVuMeterWidget = new WVuMeterGL(m_pParent); + // Note: For some reasons we need to create the widget without a parent to avoid to + // create two platform windows in QWidget::create() for this widget. + // This happens, because the QWidget::create() of a parent() will populate all children + // with platform windows q_createNativeChildrenAndSetParent() while another window is already + // under construction. The ID for the first window is not cleared and leads to a segfault + // during on shutdown + WVuMeterGL* pVuMeterWidget = new WVuMeterGL(); + pVuMeterWidget->setParent(m_pParent); commonWidgetSetup(node, pVuMeterWidget); waveformWidgetFactory->addVuMeter(pVuMeterWidget);