Fix clicking on monitor ruler not activating monitor

parent 3f751ffe
......@@ -64,7 +64,8 @@ void DvdWizardChapters::stopMonitor()
void DvdWizardChapters::slotUpdateChaptersList()
{
m_monitor->show();
m_manager->activateMonitor(Kdenlive::DvdMonitor, true);
m_manager->activateMonitor(Kdenlive::DvdMonitor);
m_monitor->start();
m_monitor->slotOpenDvdFile(m_view.vob_list->currentText());
m_monitor->adjustRulerSize(m_view.vob_list->itemData(m_view.vob_list->currentIndex(), Qt::UserRole).toInt());
QStringList currentChaps = m_view.vob_list->itemData(m_view.vob_list->currentIndex(), Qt::UserRole + 1).toStringList();
......@@ -162,7 +163,8 @@ void DvdWizardChapters::createMonitor(DVDFORMAT format)
m_view.video_frame->layout()->addWidget(m_monitor);
m_manager->appendMonitor(m_monitor);
m_monitor->setCustomProfile(profile, m_tc);
m_manager->activateMonitor(Kdenlive::DvdMonitor, true);
m_manager->activateMonitor(Kdenlive::DvdMonitor);
m_monitor->start();
}
}
......
......@@ -38,7 +38,7 @@ bool AbstractMonitor::isActive() const
return m_monitorManager->isActive(m_id);
}
bool AbstractMonitor::slotActivateMonitor(bool forceRefresh)
bool AbstractMonitor::slotActivateMonitor()
{
return m_monitorManager->activateMonitor(m_id, forceRefresh);
return m_monitorManager->activateMonitor(m_id);
}
......@@ -89,7 +89,7 @@ public slots:
virtual void slotPlay() = 0;
virtual void refreshMonitorIfActive() = 0;
virtual void slotMouseSeek(int eventDelta, uint modifiers) = 0;
bool slotActivateMonitor(bool forceRefresh = false);
bool slotActivateMonitor();
virtual void slotSwitchFullScreen(bool minimizeOnly = false) = 0;
protected:
......
......@@ -167,6 +167,7 @@ signals:
void passKeyEvent(QKeyEvent *);
void panView(const QPoint &diff);
void seekPosition(int);
void activateMonitor();
protected:
Mlt::Filter *m_glslManager;
......@@ -305,6 +306,7 @@ public:
int seekPosition() const { return m_seekPosition; }
Q_INVOKABLE void requestSeekPosition(int pos)
{
q->activateMonitor();
m_seekPosition = pos;
emit seekPositionChanged();
emit seekRequestChanged();
......
......@@ -161,6 +161,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
connect(m_glMonitor, &GLWidget::passKeyEvent, this, &Monitor::doKeyPressEvent);
connect(m_glMonitor, &GLWidget::panView, this, &Monitor::panView);
connect(m_glMonitor, &GLWidget::seekPosition, this, &Monitor::slotSeekPosition, Qt::DirectConnection);
connect(m_glMonitor, &GLWidget::activateMonitor, this, &AbstractMonitor::slotActivateMonitor, Qt::DirectConnection);
m_monitorController = new MonitorController(m_glMonitor);
m_videoWidget = QWidget::createWindowContainer(qobject_cast<QWindow *>(m_glMonitor));
m_videoWidget->setAcceptDrops(true);
......@@ -380,7 +381,7 @@ void Monitor::setOffsetY(int y)
void Monitor::slotGetCurrentImage(bool request)
{
m_glMonitor->sendFrameForAnalysis = request;
m_monitorManager->activateMonitor(m_id, false);
m_monitorManager->activateMonitor(m_id);
refreshMonitorIfActive();
if (request) {
// Update analysis state
......@@ -1254,7 +1255,8 @@ void Monitor::start()
void Monitor::slotRefreshMonitor(bool visible)
{
if (visible) {
slotActivateMonitor(true);
slotActivateMonitor();
start();
}
}
......@@ -1752,7 +1754,8 @@ void Monitor::warningMessage(const QString &text, int timeout, const QList<QActi
void Monitor::activateSplit()
{
loadQmlScene(MonitorSceneSplit);
slotActivateMonitor(true);
slotActivateMonitor();
start();
}
void Monitor::slotSwitchCompare(bool enable)
......@@ -1781,7 +1784,8 @@ void Monitor::slotSwitchCompare(bool enable)
delete m_splitEffect;
m_splitEffect = nullptr;
loadQmlScene(MonitorSceneDefault);
slotActivateMonitor(true);
slotActivateMonitor();
start();
return;
}
......
......@@ -133,15 +133,12 @@ void MonitorManager::refreshClipMonitor()
m_clipMonitor->refreshMonitorIfActive();
}
bool MonitorManager::activateMonitor(Kdenlive::MonitorId name, bool forceRefresh)
bool MonitorManager::activateMonitor(Kdenlive::MonitorId name)
{
if (m_clipMonitor == nullptr || m_projectMonitor == nullptr) {
return false;
}
if ((m_activeMonitor != nullptr) && m_activeMonitor->id() == name) {
if (forceRefresh) {
m_activeMonitor->start();
}
return false;
}
QMutexLocker locker(&m_switchMutex);
......
......@@ -73,7 +73,7 @@ public slots:
/** @brief Activates a monitor.
* @param name name of the monitor to activate */
bool activateMonitor(Kdenlive::MonitorId, bool forceRefresh = false);
bool activateMonitor(Kdenlive::MonitorId);
bool isActive(Kdenlive::MonitorId id) const;
void slotPlay();
void slotPause();
......
......@@ -230,7 +230,8 @@ void ProjectManager::newFile(bool showProjectSettings, bool force)
emit docOpened(m_project);
// pCore->monitorManager()->activateMonitor(Kdenlive::ClipMonitor);
m_lastSave.start();
pCore->monitorManager()->activateMonitor(Kdenlive::ClipMonitor, true);
pCore->monitorManager()->activateMonitor(Kdenlive::ClipMonitor);
pCore->getMonitor(Kdenlive::ClipMonitor)->start();
}
bool ProjectManager::closeCurrentDocument(bool saveChanges, bool quit)
......@@ -599,8 +600,8 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
m_lastSave.start();
delete m_progressDialog;
m_progressDialog = nullptr;
pCore->monitorManager()->activateMonitor(Kdenlive::ProjectMonitor, true);
// pCore->monitorManager()->projectMonitor()->refreshMonitorIfActive();
pCore->monitorManager()->activateMonitor(Kdenlive::ProjectMonitor);
pCore->getMonitor(Kdenlive::ClipMonitor)->start();
}
void ProjectManager::slotRevert()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment