fix:auth window could'n show

This commit is contained in:
yangmin100 2024-11-15 16:52:31 +08:00
parent 3363113272
commit 6d82cd8c13
1 changed files with 19 additions and 19 deletions

View File

@ -338,17 +338,17 @@ void FullScreenBackground::moveToScreen(QScreen *screen)
void FullScreenBackground::moveToCursorScreen()
{
bool isFoundScreen = false;
if (m_isWayland) {
QString strCurScreen = WindowManager::currentOutputName();
for (auto screen : QApplication::screens()) {
qDebug() << "Screen:" << screen->name() << "," << screen->geometry();
if (screen && screen->name() == strCurScreen) {
isFoundScreen = true;
moveToScreen(screen);
break;
}
}
} else {
// if (m_isWayland) {
// QString strCurScreen = WindowManager::currentOutputName();
// for (auto screen : QApplication::screens()) {
// qDebug() << "Screen:" << screen->name() << "," << screen->geometry();
// if (screen && screen->name() == strCurScreen) {
// isFoundScreen = true;
// moveToScreen(screen);
// break;
// }
// }
// } else {
QPoint cursor = QCursor::pos();
for (auto screen : QApplication::screens()) {
qDebug() << "Screen:" << screen->name() << "," << screen->geometry();
@ -358,7 +358,7 @@ void FullScreenBackground::moveToCursorScreen()
break;
}
}
}
// }
if (!isFoundScreen) {
if (QApplication::primaryScreen()) {
moveToScreen(QApplication::primaryScreen());