Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add transient_seat_v1 implementation #484

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

Draft
zzxyb wants to merge 1 commit into linuxdeepin:master
base: master
Choose a base branch
Loading
from zzxyb:for-0.19

Conversation

@zzxyb
Copy link
Collaborator

@zzxyb zzxyb commented Aug 4, 2025
edited by sourcery-ai bot
Loading

Create separate seats for virtual-pointer and virtual-keyboard

Log:

Summary by Sourcery

Add transient seat v1 support by including its manager, connecting creation signals, and spawning WSeat instances with proper lifecycle handling.

New Features:

  • Integrate the transient_seat_v1 protocol into the seat helper
  • Handle notify_create_seat events to dynamically allocate and manage new virtual seats

Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zzxyb

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

Copy link

sourcery-ai bot commented Aug 4, 2025

Reviewer's Guide

Adds support for the Wayland transient_seat_v1 protocol by wiring up the transient seat manager in Helper, handling seat creation notifications to instantiate and manage WSeat objects, and responding with ready or deny to the compositor.

Sequence diagram for transient_seat_v1 seat creation flow

sequenceDiagram
 participant TransientSeatManager as qw_transient_seat_manager_v1
 participant Helper
 participant TransientSeat as qw_transient_seat_v1
 participant Seat as WSeat
 participant NativeSeat as qw_seat
 TransientSeatManager->>Helper: notify_create_seat(transientSeat)
 Helper->>TransientSeat: qw_transient_seat_v1::from(transientSeat)
 Helper->>Helper: Create WSeat(name)
 Helper->>Seat: Check nativeHandle()
 alt nativeHandle exists
 Helper->>NativeSeat: connect destroyed -> safeDeleteLater
 Helper->>TransientSeat: ready(seat->nativeHandle())
 else nativeHandle missing
 Helper->>TransientSeat: deny()
 end
Loading

Class diagram for Helper and transient seat manager integration

classDiagram
 class Helper {
 +void init()
 -qw_transient_seat_manager_v1 *m_transientSeatManager
 }
 class qw_transient_seat_manager_v1 {
 +signal notify_create_seat(wlr_transient_seat_v1*)
 }
 class qw_transient_seat_v1 {
 +static from(wlr_transient_seat_v1*)
 +ready(qw_seat*)
 +deny()
 }
 class WSeat {
 +WSeat(QString name)
 +nativeHandle()
 +safeDeleteLater()
 +handle()
 }
 class qw_seat {
 +signal destroyed
 }
 Helper --> qw_transient_seat_manager_v1 : uses
 Helper --> WSeat : creates
 Helper --> qw_transient_seat_v1 : uses
 WSeat --> qw_seat : nativeHandle/handle
 qw_seat --> Helper : destroyed signal
 qw_transient_seat_manager_v1 --> Helper : notify_create_seat signal
 qw_transient_seat_v1 --> Helper : ready/deny methods
Loading

File-Level Changes

Change Details Files
Integrate transient seat v1 protocol support into Helper
  • Add qwtransientseatv1 include
  • Declare m_transientSeatManager member
  • Connect notify_create_seat signal in Helper::init()
src/seat/helper.cpp
src/seat/helper.h
Implement transient seat creation and lifecycle handling
  • Convert wlr_transient_seat_v1 to qw_transient_seat_v1
  • Generate unique seat names
  • Instantiate WSeat and check native handle
  • Connect destroy signal for safe deletion
  • Invoke ready or deny on transient seats
src/seat/helper.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!

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

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 @zzxyb - I've reviewed your changes - here's some feedback:

  • You need to instantiate m_transientSeatManager (e.g. via qw_transient_seat_manager_v1::create) before connecting to its notify_create_seat signal.
  • Consider using a more robust identifier generator (such as a UUID or atomic counter) instead of a static uint64_t to avoid potential overflow or collisions in seat names.
  • Add logging in the deny branch to capture and diagnose why a transient seat request was refused at runtime.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- You need to instantiate m_transientSeatManager (e.g. via qw_transient_seat_manager_v1::create) before connecting to its notify_create_seat signal.
- Consider using a more robust identifier generator (such as a UUID or atomic counter) instead of a static uint64_t to avoid potential overflow or collisions in seat names.
- Add logging in the deny branch to capture and diagnose why a transient seat request was refused at runtime.
## Individual Comments
### Comment 1
<location> `src/seat/helper.cpp:1075` </location>
<code_context>
 qw_alpha_modifier_v1::create(*m_server->handle());
+ connect(m_transientSeatManager, &qw_transient_seat_manager_v1::notify_create_seat, this, [this](wlr_transient_seat_v1 *transientSeat) {
+  qw_transient_seat_v1 *qwTransientSeat = qw_transient_seat_v1::from(transientSeat);
+  static uint64_t i = 0;
+  QString name = QStringLiteral("transient-%1").arg(i++, 0, 10);
+  WSeat *seat = new WSeat(name);
</code_context>
<issue_to_address>
Use of static variable for seat naming may cause issues in multi-instance scenarios.
Using a static variable here can cause seat name collisions if multiple Helper instances exist. Use a member variable or a more reliable unique identifier instead.
Suggested implementation:
```cpp
 QString name = QStringLiteral("transient-%1").arg(m_transientSeatCounter++, 0, 10);
```
1. Add a member variable `uint64_t m_transientSeatCounter = 0;` to the class definition (likely in `helper.h`).
2. Initialize `m_transientSeatCounter` in the class constructor if not using in-class initialization.
3. Ensure all usages of the seat naming counter use this member variable.
</issue_to_address>

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.

sourcery-ai[bot] reacted with thumbs up emoji sourcery-ai[bot] reacted with thumbs down emoji
Copy link

deepin-bot bot commented Aug 4, 2025

TAG Bot

New tag: 0.6.2
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #486

Create separate seats for virtual-pointer and virtual-keyboard
Log:
@zzxyb zzxyb requested a review from wineee August 28, 2025 02:58
@wineee wineee marked this pull request as draft August 28, 2025 05:44
Copy link

deepin-bot bot commented Aug 29, 2025

TAG Bot

New tag: 0.7.0
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #540

Copy link

deepin-bot bot commented Sep 18, 2025

TAG Bot

New tag: 0.7.1
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #560

Copy link

deepin-bot bot commented Sep 19, 2025

TAG Bot

New tag: 0.7.2
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #562

Copy link

deepin-bot bot commented Sep 23, 2025

TAG Bot

New tag: 0.7.3
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #569

Copy link

deepin-bot bot commented Oct 30, 2025

TAG Bot

New tag: 0.7.6
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #611

Copy link

deepin-bot bot commented Nov 7, 2025

TAG Bot

New tag: 0.7.7
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #619

Copy link

deepin-bot bot commented Nov 14, 2025

TAG Bot

New tag: 0.7.8
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #625

Copy link

deepin-bot bot commented Jan 4, 2026

TAG Bot

New tag: 0.8.0
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #676

Copy link

deepin-bot bot commented Jan 15, 2026

TAG Bot

New tag: 0.8.1
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #691

Copy link

deepin-bot bot commented Jan 30, 2026

TAG Bot

New tag: 0.8.2
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #718

Copy link

deepin-bot bot commented Feb 4, 2026

TAG Bot

New tag: 0.8.3
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #733

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sourcery-ai sourcery-ai[bot] sourcery-ai[bot] left review comments

@wineee wineee Awaiting requested review from wineee

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /