-
Notifications
You must be signed in to change notification settings - Fork 12
fix: 修复拓展坞外接4k屏注销后登录界面位置错误的问题 #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#36
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Mars-cb, waterlovemelon The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
部分机器x未初始化完成导致设置的geometry未生效,增加容错时间检查geometry并重新设置 Log: Bug: https://pms.uniontech.com/bug-view-332651.html Influence: 登录界面位置 Change-Id: I9315076978ade341c56fc410868ef31d1940e50d
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#36
deepin pr auto review我来分析这段代码的变更,并提供一些改进建议: 代码变更分析:
改进建议:
建议的改进代码:// 在头文件中定义常量
static const int GEOMETRY_RESET_TIMEOUT = 400;
static const int GEOMETRY_RESET_DELAY = 200;
// 构造函数中
connect(m_resetGeometryTimer, &QTimer::timeout, this, [this]() {
const auto currentGeometry = geometry();
if (currentGeometry != m_geometryRect) {
qCDebug(DCE_SHELL) << "Geometry mismatch. Current:" << currentGeometry
<< "Expected:" << m_geometryRect;
setGeometry(m_geometryRect);
}
});
// 改进后的 setddeGeometry 函数
void FullScreenBackground::setddeGeometry(const QRect &rect)
{
if (rect == geometry()) {
return; // 无需更新
}
setGeometry(rect);
m_geometryRect = rect;
if (!m_resetGeometryTimer) {
qCWarning(DCE_SHELL) << "Reset geometry timer is not initialized";
return;
}
m_resetGeometryTimer->start(GEOMETRY_RESET_DELAY);
QTimer::singleShot(GEOMETRY_RESET_TIMEOUT * 5, m_resetGeometryTimer, &QTimer::stop);
}
// 析构函数中
FullScreenBackground::~FullScreenBackground()
{
if (m_resetGeometryTimer) {
m_resetGeometryTimer->stop();
}
}这些改进可以提高代码的可维护性、性能和安全性,同时保持原有功能不变。 |
|
/meger |
|
/merge |
|
This pr cannot be merged! (status: unstable) |
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#36
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#36
部分机器x未初始化完成导致设置的geometry未生效,增加容错时间检查geometry并重新设置
Log:
Bug: https://pms.uniontech.com/bug-view-332651.html
Influence: 登录界面位置
Change-Id: I9315076978ade341c56fc410868ef31d1940e50d