#127740 wayland下默认全屏切换动画位置异常,不显示动画

This commit is contained in:
lixueman 2022-07-15 08:32:52 +08:00
parent fc64d52106
commit dd032cfdb9
1 changed files with 15 additions and 9 deletions

View File

@ -1240,14 +1240,16 @@ void MainWindow::on_minMaxChangeButton_clicked()
m_canHide = true;
m_isFullScreen = true;
m_animationPage->show();
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(this->x(), this->y(), Style::minw, Style::minh));
m_maxAnimation->setDuration(1);
} else {
m_animationPage->show();
m_animationPage->setGeometry(this->x(), this->y(), Style::minw, Style::minh);
}
m_animationPage->raise();
m_animationPage->repaint();
m_maxAnimation->setDuration(260);
}
QEventLoop loop;
QTimer::singleShot(100, &loop, SLOT(quit()));
loop.exec();
@ -1255,7 +1257,7 @@ void MainWindow::on_minMaxChangeButton_clicked()
// m_maxAnimation->setStartValue(QRect(Style::m_primaryScreenX, Style::m_primaryScreenY + Style::m_availableScreenHeight - Style::minh, Style::minw, Style::minh));
m_maxAnimation->setStartValue(QRect(this->x(), this->y(), Style::minw, Style::minh));
m_maxAnimation->setEndValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
m_maxAnimation->setDuration(260);
m_maxAnimation->start();
this->hide();
}
@ -1354,13 +1356,17 @@ void MainWindow::repaintWidget()
void MainWindow::showNormalWindowSlot()
{
myDebug() << "Style::m_availableScreenWidth" << Style::m_availableScreenWidth << "Style::m_availableScreenHeight" << Style::m_availableScreenHeight;
m_animationPage->show();
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
m_minAnimation->setDuration(1);
} else {
m_animationPage->show();
m_animationPage->setGeometry(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight);
}
m_animationPage->raise();
m_animationPage->repaint();
m_minAnimation->setDuration(260);
}
myDebug() << m_animationPage->rect();
QEventLoop loop;
QTimer::singleShot(100, &loop, SLOT(quit()));
@ -1369,7 +1375,7 @@ void MainWindow::showNormalWindowSlot()
m_minAnimation->setEasingCurve(QEasingCurve::OutExpo);
m_minAnimation->setStartValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
m_minAnimation->setEndValue(QRect(this->x(), this->y(), Style::minw, Style::minh));
m_minAnimation->setDuration(260);
m_minAnimation->start();
m_fullWindow->hide();
}