[PATCH weston 3/4] compositor-drm: Enable seat constraining when configured in weston.ini
Pekka Paalanen
ppaalanen at gmail.com
Tue Jun 11 05:33:46 PDT 2013
Hi Rob,
I think patches 2, 3, and 4 should be all squashed, and I would like to
know more of what is the use case here.
More questions below.
On Mon, 10 Jun 2013 15:17:30 +0100
Rob Bradford <robert.bradford at intel.com> wrote:
> From: Rob Bradford <rob at linux.intel.com>
>
> ---
> src/compositor-drm.c | 16 ++++++++++++++++
> src/compositor.h | 2 ++
> src/input.c | 2 ++
> src/udev-seat.c | 3 +++
> 4 files changed, 23 insertions(+)
>
> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> index 76d0810..7d33977 100644
> --- a/src/compositor-drm.c
> +++ b/src/compositor-drm.c
> @@ -1796,6 +1796,22 @@ create_output_for_connector(struct drm_compositor *ec,
> transform = parse_transform(s, output->base.name);
> free(s);
>
> + weston_config_section_get_string(section, "seat", &s, "");
> + if (strcmp(s, "") != 0) {
> + struct udev_seat *seat;
> +
> + seat = udev_seat_get_named(&ec->base, s);
> + if (seat) {
> + seat->base.output = &output->base;
> + if (seat->base.pointer) {
> + weston_pointer_output_center(seat->base.pointer,
> + &output->base);
Does this mean, that every time an output is hotplugged in this seat,
the pointer will warp?
What if a seat has several outputs?
> + }
> + }
> + }
> +
> + free(s);
> +
> output->crtc_id = resources->crtcs[i];
> output->pipe = i;
> ec->crtc_allocator |= (1 << output->crtc_id);
> diff --git a/src/compositor.h b/src/compositor.h
> index d2ca844..68845ab 100644
> --- a/src/compositor.h
> +++ b/src/compositor.h
> @@ -425,6 +425,8 @@ struct weston_seat {
> struct weston_keyboard *keyboard;
> struct weston_touch *touch;
>
> + struct weston_output *output; /* constraint */
> +
> struct wl_signal destroy_signal;
>
> struct weston_compositor *compositor;
> diff --git a/src/input.c b/src/input.c
> index 7c7aa95..ef99899 100644
> --- a/src/input.c
> +++ b/src/input.c
> @@ -585,6 +585,8 @@ clip_pointer_motion(struct weston_seat *seat, wl_fixed_t *fx, wl_fixed_t *fy)
> old_y = wl_fixed_to_int(seat->pointer->y);
>
> wl_list_for_each(output, &ec->output_list, link) {
> + if (seat->output && seat->output != output)
> + continue;
> if (pixman_region32_contains_point(&output->region,
> x, y, NULL))
> valid = 1;
> diff --git a/src/udev-seat.c b/src/udev-seat.c
> index bd25535..8df588a 100644
> --- a/src/udev-seat.c
> +++ b/src/udev-seat.c
> @@ -115,6 +115,9 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
>
> wl_list_insert(seat->devices_list.prev, &device->link);
>
> + if (seat->base.output && seat->base.pointer)
> + weston_pointer_output_center(seat->base.pointer, seat->base.output);
Do I understand right, that whenever any input device is hotplugged,
like a keyboard, the pointer will warp?
> +
> return 0;
> }
>
From the man page patch:
+.BI "seat=" name
+The logical seat name that that this output should be associated with. If this
+is set then the seat's input will be confined to the output that has the seat
+set on it. The expectation is that this functionality will be used in a
+multiheaded environment with a single compositor for multiple output and
+input configurations.
So, this is an output key. It is almost as if you were trying to
implement seats by using wl_seats. I don't think that will work. Like
here, you try to confine the pointer, but what if a user alt+tabs? No
constraints there. I'm confused what this is trying to achieve.
Let me explain. I believe that wl_seat is misnamed. wl_seat is a set of
foci for a set on input devices, used by one person, or by several
people collaborating on a common desktop. Everyone has access to
everything, using their own input devices.
A seat is a physical entity, a console; an output or outputs, and the
associated input devices. Each seat has its own user session(s), which
is easiest to implement by running a compositor per seat. Sessions are
separate by definition, and for security. Separating the sessions within
a compositor is very hard.
I think, that seats are configured in udev, and wl_seats will be
configured in weston.ini or equivalent per-session configuration. A seat
may have multiple wl_seats, if you want e.g. multi-pointer. Currently,
we have no implementation for configuring multiple wl_seats;
device_added() will ignore all devices that do not match the wanted
ID_SEAT property, and only one udev_input with a wanted seat_id is
created in a backend.
Could you elaborate on what you are trying to do?
Thanks,
pq
More information about the wayland-devel
mailing list