Add support for multiple seats while using Wayland [chromium/src : main]

19 views
Skip to first unread message

Max Ihlenfeldt (Gerrit)

unread,
Jun 25, 2024, 8:42:51 AM6/25/24
to Lachlan Frawley, Chromium LUCI CQ, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Lachlan Frawley

Max Ihlenfeldt added 1 comment

File ui/ozone/platform/wayland/host/wayland_connection.h
Line 503, Patchset 1 (Latest): base::flat_map<uint32_t, std::unique_ptr<WaylandSeat>> extra_seats_;
Max Ihlenfeldt . unresolved

What's the reason for differentiating between the primary seat and the extra seats? This is not a concept that's in the spec, is it?

It seems `seat_` is used in a few places (e.g. [here](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/host/wayland_connection.cc;l=431;drc=90cac1911508d3d682a67c97aa62483eb712f69a), [here](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/host/wayland_connection.cc;l=415;drc=90cac1911508d3d682a67c97aa62483eb712f69a], and [here](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/host/wayland_connection.cc;l=693;drc=90cac1911508d3d682a67c97aa62483eb712f69a)) and `WaylandConnection::seat()` also currently has 27 non-test and non-DCHECK references. I'm not too familiar with the details of multi-seat setups, so I'm not sure if just creating the additional pointer/keyboard/touch devices and leaving all these call sites to be primary-seat-only is enough/correct.
For example, is it enough to handle drags only for the primary seat (i.e. only call `wl_data_device_manager.get_data_device()` for that one seat)? Starting a drag using the data device from seat 1 in response to pointer events from seat 2 seems weird to me.

Open in Gerrit

Related details

Attention is currently required from:
  • Lachlan Frawley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9701036f4286700f03c680fcf06f732601fa1640
Gerrit-Change-Number: 5652465
Gerrit-PatchSet: 1
Gerrit-Owner: Lachlan Frawley <lachf...@gmail.com>
Gerrit-Reviewer: Lachlan Frawley <lachf...@gmail.com>
Gerrit-Reviewer: Max Ihlenfeldt <m...@igalia.com>
Gerrit-Attention: Lachlan Frawley <lachf...@gmail.com>
Gerrit-Comment-Date: Tue, 25 Jun 2024 12:42:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Lachlan Frawley (Gerrit)

unread,
Jun 25, 2024, 3:11:49 PM6/25/24
to Chromium LUCI CQ, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Max Ihlenfeldt

Lachlan Frawley added 1 comment

File ui/ozone/platform/wayland/host/wayland_connection.h
Line 503, Patchset 1 (Latest): base::flat_map<uint32_t, std::unique_ptr<WaylandSeat>> extra_seats_;
Max Ihlenfeldt . unresolved

What's the reason for differentiating between the primary seat and the extra seats? This is not a concept that's in the spec, is it?

It seems `seat_` is used in a few places (e.g. [here](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/host/wayland_connection.cc;l=431;drc=90cac1911508d3d682a67c97aa62483eb712f69a), [here](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/host/wayland_connection.cc;l=415;drc=90cac1911508d3d682a67c97aa62483eb712f69a], and [here](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/host/wayland_connection.cc;l=693;drc=90cac1911508d3d682a67c97aa62483eb712f69a)) and `WaylandConnection::seat()` also currently has 27 non-test and non-DCHECK references. I'm not too familiar with the details of multi-seat setups, so I'm not sure if just creating the additional pointer/keyboard/touch devices and leaving all these call sites to be primary-seat-only is enough/correct.
For example, is it enough to handle drags only for the primary seat (i.e. only call `wl_data_device_manager.get_data_device()` for that one seat)? Starting a drag using the data device from seat 1 in response to pointer events from seat 2 seems weird to me.

Lachlan Frawley

I'll have to take a look at this. I never really considered much outside of 'keyboard and mouse works over VNC' when creating the original patch.

Open in Gerrit

Related details

Attention is currently required from:
  • Max Ihlenfeldt
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9701036f4286700f03c680fcf06f732601fa1640
Gerrit-Change-Number: 5652465
Gerrit-PatchSet: 1
Gerrit-Owner: Lachlan Frawley <lachf...@gmail.com>
Gerrit-Reviewer: Lachlan Frawley <lachf...@gmail.com>
Gerrit-Reviewer: Max Ihlenfeldt <m...@igalia.com>
Gerrit-Attention: Max Ihlenfeldt <m...@igalia.com>
Gerrit-Comment-Date: Tue, 25 Jun 2024 19:11:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Max Ihlenfeldt <m...@igalia.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Lachlan Frawley (Gerrit)

unread,
Jun 26, 2024, 6:05:48 AM6/26/24
to Chromium LUCI CQ, chromium...@chromium.org, max+watc...@igalia.com, nickdiego+wa...@igalia.com, ozone-...@chromium.org
Attention needed from Max Ihlenfeldt

Lachlan Frawley added 1 comment

File ui/ozone/platform/wayland/host/wayland_connection.h
Line 503, Patchset 1 (Latest): base::flat_map<uint32_t, std::unique_ptr<WaylandSeat>> extra_seats_;
Max Ihlenfeldt . unresolved

What's the reason for differentiating between the primary seat and the extra seats? This is not a concept that's in the spec, is it?

It seems `seat_` is used in a few places (e.g. [here](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/host/wayland_connection.cc;l=431;drc=90cac1911508d3d682a67c97aa62483eb712f69a), [here](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/host/wayland_connection.cc;l=415;drc=90cac1911508d3d682a67c97aa62483eb712f69a], and [here](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/host/wayland_connection.cc;l=693;drc=90cac1911508d3d682a67c97aa62483eb712f69a)) and `WaylandConnection::seat()` also currently has 27 non-test and non-DCHECK references. I'm not too familiar with the details of multi-seat setups, so I'm not sure if just creating the additional pointer/keyboard/touch devices and leaving all these call sites to be primary-seat-only is enough/correct.
For example, is it enough to handle drags only for the primary seat (i.e. only call `wl_data_device_manager.get_data_device()` for that one seat)? Starting a drag using the data device from seat 1 in response to pointer events from seat 2 seems weird to me.

Lachlan Frawley

I'll have to take a look at this. I never really considered much outside of 'keyboard and mouse works over VNC' when creating the original patch.

Lachlan Frawley

I've done some looking at the code you mentioned. I haven't had the opportunity to test my theory yet, but I think the solution I've got now just causes chrome to interpret the input from extra seats as if it came from the primary seat.

I feel like this fits with how VNC/RDP behave, since they simply replicate the screen of some target system instead of creating a new, separated instance.

Also on the difference of the "primary" and "extra" seats, I don't believe there is any mention of it in the Wayland spec. My view is that the primary seat always represents the local device seat, and can therefore have things like the cursor tied to it. The extra seats should always be transient external connections (like VNC or RDP), and should therefore not have anything associated with them, but can still interact with the window. (And if I'm being completely honest, when I first wrote this patch, I didn't think something so simple would actually work).

Open in Gerrit

Related details

Attention is currently required from:
  • Max Ihlenfeldt
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9701036f4286700f03c680fcf06f732601fa1640
Gerrit-Change-Number: 5652465
Gerrit-PatchSet: 1
Gerrit-Owner: Lachlan Frawley <lachf...@gmail.com>
Gerrit-Reviewer: Lachlan Frawley <lachf...@gmail.com>
Gerrit-Reviewer: Max Ihlenfeldt <m...@igalia.com>
Gerrit-Attention: Max Ihlenfeldt <m...@igalia.com>
Gerrit-Comment-Date: Wed, 26 Jun 2024 10:05:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Lachlan Frawley <lachf...@gmail.com>
Comment-In-Reply-To: Max Ihlenfeldt <m...@igalia.com>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages