Skip to content
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

fix: ToolTip's xsettings can't work in qt6 #279

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

18202781743
Copy link
Contributor

Window is recreated if Window's flags is Qt::ToolTip and missing
WindowStaysOnTopHint, in case, Qt will append WindowStaysOnTopHint
flag to the window in QXcbWindow::setWindowFlags, it causes
window is recreated in qt6.
We reconstruct DNoTitlebarWindowHelper to update xsettings value.
We can also add WindowStaysOnTopHint for the window.

pms: BUG-302661

@18202781743 18202781743 requested review from mhduiy and BLumia March 3, 2025 09:34
deepin-ci-robot added a commit to linuxdeepin/qt6platform-plugins that referenced this pull request Mar 3, 2025
Synchronize source files from linuxdeepin/qt5platform-plugins.

Source-pull-request: linuxdeepin/qt5platform-plugins#279
@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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

Window is recreated if Window's flags is Qt::ToolTip and missing
WindowStaysOnTopHint, in case, Qt will append WindowStaysOnTopHint
flag to the window in QXcbWindow::setWindowFlags, it causes
window is recreated in qt6.
We reconstruct DNoTitlebarWindowHelper to update xsettings value.
We can also add WindowStaysOnTopHint for the window.

pms: BUG-302661
deepin-ci-robot added a commit to linuxdeepin/qt6platform-plugins that referenced this pull request Mar 5, 2025
Synchronize source files from linuxdeepin/qt5platform-plugins.

Source-pull-request: linuxdeepin/qt5platform-plugins#279
@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

关键摘要:

  • nativeWindowCreated函数中,Q_UNUSED(new DNoTitlebarWindowHelper(w->window(), w->winId()))使用了Q_UNUSED宏,但没有实际使用DNoTitlebarWindowHelper对象,可能是一个错误。
  • nativeWindowDestroyed函数中,w->setProperty("_d_dxcb_noTitleHelper_destroyed", true);设置了一个布尔属性,但没有在代码中看到对应的清理逻辑,可能会导致资源泄露。
  • nativeWindowCreatednativeWindowDestroyed函数中使用了宏VtableHook::overrideVfptrFun,这可能会影响Qt的内存管理,需要确认是否有必要使用这种方式,并且是否正确处理了所有可能的内存管理情况。
  • nativeWindowCreated函数中,qCDebug(lcDxcb) << "window is recreated:" << w->window() << ", winId:" << w->winId();在窗口被重新创建时打印调试信息,但没有看到对应的错误处理或日志记录,可能需要添加更多的日志信息来帮助调试。

是否建议立即修改:

  • 确认Q_UNUSED(new DNoTitlebarWindowHelper(w->window(), w->winId()))的使用是否正确,如果不需要这个对象,应该移除这行代码。
  • nativeWindowDestroyed函数中添加清理逻辑,确保资源被正确释放。
  • 评估VtableHook::overrideVfptrFun的使用是否必要,并确保内存管理正确。
  • 增加更多的日志信息,以便在窗口重新创建时更好地进行调试。

@18202781743 18202781743 merged commit 7e318f3 into linuxdeepin:master Mar 5, 2025
18 of 20 checks passed
18202781743 pushed a commit to linuxdeepin/qt6platform-plugins that referenced this pull request Mar 5, 2025
Synchronize source files from linuxdeepin/qt5platform-plugins.

Source-pull-request: linuxdeepin/qt5platform-plugins#279
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