mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
feat: 修复2d模式下从任务栏拖拽应用交换位置卡顿问题
onFollowMouse()每1毫秒执行一次影响了系统性能影响了DragMove事件传递 修改为16ms,更新频次接近60Hz. Log: Task: https://pms.uniontech.com/zentao/task-view-95274.html Influence: 任务栏-2d模式下拖动应用交换位置流畅,不再卡顿 Change-Id: I4cfb70098081af06290c54c93d065425c20dc482
This commit is contained in:
parent
3f073306d1
commit
0f538d708a
@ -70,9 +70,9 @@ AppDragWidget::AppDragWidget(QWidget *parent)
|
||||
setAcceptDrops(true);
|
||||
|
||||
initAnimations();
|
||||
|
||||
|
||||
m_followMouseTimer->setSingleShot(Utils::IS_WAYLAND_DISPLAY);
|
||||
m_followMouseTimer->setInterval(1);
|
||||
m_followMouseTimer->setInterval(16);
|
||||
connect(m_followMouseTimer, &QTimer::timeout, this, &AppDragWidget::onFollowMouse);
|
||||
m_followMouseTimer->start();
|
||||
}
|
||||
@ -376,7 +376,7 @@ void AppDragWidget::onFollowMouse()
|
||||
if (DWindowManagerHelper::instance()->hasComposite()) {
|
||||
move(destPos.x() - width() / 2, destPos.y() - height() / 2);
|
||||
} else {
|
||||
move(destPos.x(), destPos.y()); //窗口特效未开启时会隐藏m_object绘制的图标,移动的图标为QDrag绘制的图标,大小为(10,10)
|
||||
move(destPos.x(), destPos.y()); // 窗口特效未开启时会隐藏m_object绘制的图标,移动的图标为QDrag绘制的图标
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -422,6 +422,8 @@ void MainPanelControl::removeItem(DockItem *item)
|
||||
break;
|
||||
}
|
||||
|
||||
item->removeEventFilter(this);
|
||||
|
||||
/** 此处重新计算大小的时候icon的个数在原有个数上减少了一个,导致每个icon的大小跟原来大小不一致,需要重新设置setFixedSize
|
||||
* 在龙芯处理器上当app数量过多时,会导致拖动app耗时严重,造成卡顿
|
||||
* 注意:不能屏蔽此接口,否则会造成插件移除时无法更新icon大小
|
||||
|
Loading…
x
Reference in New Issue
Block a user