Cycle active window with button

A new button is added to the UI so that we can cycle the currently active window when there are more windows to capture.  It's like pressing the F11 button but it works on Android too.
This commit is contained in:
tabi.katalin
2018-10-10 10:19:43 +01:00
committed by Baldur Karlsson
parent c132142723
commit 369d93b99c
9 changed files with 112 additions and 30 deletions
@@ -122,6 +122,7 @@ LiveCapture::LiveCapture(ICaptureContext &ctx, const QString &hostname, const QS
ui->triggerDelayedCapture->setEnabled(false);
ui->triggerImmediateCapture->setEnabled(false);
ui->queueCap->setEnabled(false);
ui->cycleActiveWindow->setEnabled(false);
ui->target->setText(QString());
@@ -282,6 +283,11 @@ void LiveCapture::on_triggerImmediateCapture_clicked()
m_CaptureNumFrames = (int)ui->numFrames->value();
}
void LiveCapture::on_cycleActiveWindow_clicked()
{
m_Connection->CycleActiveWindow();
}
void LiveCapture::on_triggerDelayedCapture_clicked()
{
if(ui->captureDelay->value() == 0.0)
@@ -1257,6 +1263,12 @@ void LiveCapture::connectionThreadEntry()
}
}
}
if(msg.type == TargetControlMessageType::CapturableWindowCount)
{
uint32_t windows = msg.capturableWindowCount;
GUIInvoke::call(this, [this, windows]() { ui->cycleActiveWindow->setEnabled(windows > 1); });
}
}
GUIInvoke::call(this, [this]() {
@@ -1269,6 +1281,7 @@ void LiveCapture::connectionThreadEntry()
ui->triggerDelayedCapture->setEnabled(false);
ui->triggerImmediateCapture->setEnabled(false);
ui->queueCap->setEnabled(false);
ui->cycleActiveWindow->setEnabled(false);
ui->apiStatus->setText(tr("None"));
ui->apiIcon->setVisible(false);