Skip to content

Conversation

@tsic404
Copy link
Contributor

@tsic404 tsic404 commented Dec 12, 2024

  1. when hideModeChanged to start show/hide timer
  2. make the dock's rect is the original size so that the window rect obtained by xcb can correctly calculate whether it overlaps

log: as title
pms: BUG-293825

1. when hideModeChanged to start show/hide timer
2. make the dock's rect is the original size so
that the window rect obtained by xcb can correctly
calculate whether it overlaps

log: as title
pms: BUG-293825
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. DockHelper类中新增的信号连接使用了static_cast<void (QTimer::*)()>(&QTimer::start),这种写法虽然可以编译通过,但不够直观。建议使用函数指针或者std::function来提高代码的可读性。

  2. X11DockHelper类中新增了一个QTimer成员变量m_updateDockAreaTimer,并在构造函数中进行了初始化。这个QTimersetSingleShotsetInterval方法被调用,但未看到对应的注释说明其用途。建议添加注释来解释这个定时器的用途。

  3. X11DockHelper类中,updateDockArea函数被调用时,对rect进行了缩放和位置调整。这部分代码逻辑清晰,但未看到对应的注释说明调整的原因。建议添加注释来解释这一操作的必要性。

  4. X11DockHelper类中,updateDockArea函数被调用时,对m_dockArea进行了更新,并遍历了m_windows来更新窗口数据。这部分代码逻辑清晰,但未看到对应的注释说明更新操作的目的。建议添加注释来解释这一操作的必要性。

  5. X11DockHelper类中,updateDockArea函数被调用时,使用了parent()->devicePixelRatio()来获取设备像素比。这个方法可能会返回非整数值,但在后续的乘法和除法操作中,这些非整数值可能会被忽略。建议检查这一操作是否符合预期。

  6. X11DockHelper类中,updateDockArea函数被调用时,使用了parent()->dockScreen()来获取屏幕对象。这个方法可能会返回nullptr,但在后续的代码中未进行空指针检查。建议添加空指针检查来避免潜在的空指针异常。

  7. X11DockHelper类中,updateDockArea函数被调用时,使用了m_windows来存储窗口数据。这个数据结构的使用方式可能会导致内存泄漏,因为WindowData*指针被存储在QHash中,但未看到对应的删除操作。建议在适当的地方添加删除操作来避免内存泄漏。

  8. X11DockHelper类中,updateDockArea函数被调用时,使用了m_dockArea来存储和更新dock区域。这个数据结构的使用方式可能会导致数据不一致,因为m_dockArea的更新操作可能被多个信号触发。建议在更新m_dockArea之前,先检查是否有其他线程正在更新,以避免数据不一致的问题。

以上是针对代码修改部分的审查意见,希望能够对您有所帮助。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, tsic404

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tsic404
Copy link
Contributor Author

tsic404 commented Dec 13, 2024

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Dec 13, 2024

This pr force merged! (status: behind)

@deepin-bot deepin-bot bot merged commit 012f935 into linuxdeepin:master Dec 13, 2024
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants