Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne committed Aug 27, 2024
1 parent bac3fb8 commit 23d95c7
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/BigPictureTV/bigpicturetv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,25 +283,26 @@ void BigPictureTV::onAudioButtonClicked()

void BigPictureTV::checkWindowTitle()
{
if (ui->targetWindowComboBox->currentIndex() == 1) {
if (ui->customWindowLineEdit->text().isEmpty() || ui->customWindowLineEdit->hasFocus()) {
return;
}
}

if (isSunshineStreaming()) {
return;
}

bool disableVideo = ui->disableMonitorCheckBox->isChecked();
bool disableAudio = ui->disableAudioCheckBox->isChecked();
bool isRunning;
if (ui->targetWindowComboBox->currentIndex() == 0) {
isRunning = isBigPictureRunning();
} else if (ui->targetWindowComboBox->currentIndex() == 1) {
isRunning = isCustomWindowRunning(ui->customWindowLineEdit->text());
}
bool disableVideo = ui->disableMonitorCheckBox->isChecked();
bool disableAudio = ui->disableAudioCheckBox->isChecked();

bool customNotConfigured;
if (ui->targetWindowComboBox->currentIndex() == 1) {
if (ui->customWindowLineEdit->text().isEmpty() || ui->customWindowLineEdit->hasFocus()) {
customNotConfigured = true;
}
} else {
customNotConfigured = false;
}

if (isRunning && !gamemodeActive && !isSunshineStreaming() && !customNotConfigured) {
if (isRunning && !gamemodeActive) {
gamemodeActive = true;
handleActions(false);
handleMonitorChanges(false, disableVideo);
Expand Down

0 comments on commit 23d95c7

Please sign in to comment.