Skip to content

Commit 2cd6ae9

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 2cd6ae9

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

application/widgets/mainwindow.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-only
44

@@ -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)