Skip to content

Commit b51e2d4

Browse files
committed
fix(mainwindow): conditionally raise and activate window only when dialog was visible
- Store dialog visibility state before hiding it - Add debug logging to track dialog visibility changes - Only call raise() and activateWindow() when the dialog was previously visible - Prevent unnecessary window activation when dialog wasn't shown Log: fix(mainwindow): conditionally raise and activate window only when dialog was visible Bug: https://pms.uniontech.com/bug-view-355757.html
1 parent b84073d commit b51e2d4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

application/widgets/mainwindow.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,14 @@ void MainWindow::onShowSpinerWindow(bool isShow, const QString &title)
176176
m_dialog->setShowSpinner(isShow, title);
177177
m_dialog->show();
178178
} else {
179+
bool dialogWasVisible = m_dialog->isVisible();
179180
m_dialog->setShowSpinner(isShow, title);
180181
m_dialog->hide();
181182

182-
raise();
183-
activateWindow();
183+
qDebug() << __FUNCTION__ << "dialogWasVisible:" << dialogWasVisible;
184+
if (dialogWasVisible) {
185+
raise();
186+
activateWindow();
187+
}
184188
}
185189
}

0 commit comments

Comments
 (0)