Skip to content

Conversation

@felixonmars
Copy link
Member

@felixonmars felixonmars commented Apr 10, 2025

QtWayland removed the method at
qt/qtwayland@333bb80

This change follows layer-shell-qt's fix at
KDE/layer-shell-qt@368cf2d

Summary by Sourcery

Update Qt compatibility for layer shell surface configuration to support Qt 6.9 and newer versions

Bug Fixes:

  • Fix compatibility issue with Qt 6.9+ by replacing sendRecursiveExposeEvent() with updateExposure() method

Enhancements:

  • Add version-specific handling for window exposure events across different Qt versions

QtWayland removed the method at
qt/qtwayland@333bb80

This change follows layer-shell-qt's fix at
KDE/layer-shell-qt@368cf2d
@sourcery-ai
Copy link

sourcery-ai bot commented Apr 10, 2025

Reviewer's Guide by Sourcery

This pull request addresses a compatibility issue with Qt versions 6.9 and later. The sendRecursiveExposeEvent method was removed in QtWayland. The code was updated to use updateExposure when running with Qt 6.9 or later.

Sequence diagram for window exposure update in Qt 6.9+

sequenceDiagram
    participant Window
    participant QWaylandLayerShellSurface

    QWaylandLayerShellSurface->>Window: resizeFromApplyConfigure(m_pendingSize)
    alt Qt Version < 6.9
        Window->>Window: handleExpose(QRect(QPoint(), m_pendingSize))
    else Qt Version >= 6.9
        Window->>Window: updateExposure()
    end
Loading

File-Level Changes

Change Details Files
Addressed compatibility issues with Qt versions 6.9 and above by modifying the window update mechanism.
  • Introduced a conditional check for Qt version 6.9 or higher.
  • Replaced window()->sendRecursiveExposeEvent() with window()->updateExposure() for Qt 6.9+ to align with API changes in QtWayland.
frame/layershell/qwaylandlayershellsurface.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • 代码中使用了条件编译来处理不同版本的Qt,这可能会导致维护困难。
  • 在新版本的Qt中,updateExposure被引入,但旧版本中使用了sendRecursiveExposeEvent,这可能会导致版本兼容性问题。

是否建议立即修改:

建议的修改措施:

  • 考虑使用Qt的版本宏来统一处理不同版本的Qt,而不是使用条件编译。这样可以减少维护成本,并确保代码的清晰性和可维护性。
  • 确保所有版本的Qt都支持updateExposure方法,或者提供相应的回退机制,以避免在旧版本Qt中调用不存在的函数。
  • 如果updateExposuresendRecursiveExposeEvent的功能不同,应该明确它们之间的差异,并在文档中说明如何处理不同版本的Qt。

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @felixonmars - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider using QT_VERSION >= QT_VERSION_CHECK(6, 9, 0) instead of < in the #elif to improve readability.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@felixonmars
Copy link
Member Author

Note that the project still fails to compile on Qt 6.9 with the patch, but the remaining error seems more likely a Qt bug: https://bugreports.qt.io/browse/QTBUG-135885

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, felixonmars

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

@BLumia BLumia merged commit 6bbbff2 into linuxdeepin:master Apr 11, 2025
7 of 10 checks passed
@felixonmars felixonmars deleted the qt-6.9 branch April 11, 2025 06:40
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