[PATCH] libweston: Support autodetection of the current XDG_SEAT

Armin Krezović krezovic.armin at gmail.com
Tue Aug 15 19:36:48 UTC 2017


On 15.08.2017 04:02, nerdopolis wrote:

Hi,

> ---
>   libweston/compositor-drm.c   | 5 +++++
>   libweston/compositor-fbdev.c | 5 +++++
>   2 files changed, 10 insertions(+)
> 
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index 10adb463..44b2e448 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -3502,8 +3502,13 @@ drm_backend_create(struct weston_compositor *compositor,
>   	struct udev_device *drm_device;
>   	struct wl_event_loop *loop;
>   	const char *seat_id = default_seat;
> +	const char *session_seat;
>   	int ret;
>   
> +	session_seat=getenv("XDG_SEAT");
> +	if (session_seat)
> +		seat_id=session_seat;
> +

seat_id can already be overriden, using --seat=whatever weston option, as seen here:

https://cgit.freedesktop.org/wayland/weston/tree/compositor/main.c#n1224
https://cgit.freedesktop.org/wayland/weston/tree/libweston/compositor-drm.c#n3549

Not sure if there's same thing for fbdev backend, but even if there's not, it should
be implemented the same way.

>   	weston_log("initializing drm backend\n");
>   
>   	b = zalloc(sizeof *b);
> diff --git a/libweston/compositor-fbdev.c b/libweston/compositor-fbdev.c
> index e80a5040..81e5ec3b 100644
> --- a/libweston/compositor-fbdev.c
> +++ b/libweston/compositor-fbdev.c
> @@ -712,6 +712,11 @@ fbdev_backend_create(struct weston_compositor *compositor,
>   {
>   	struct fbdev_backend *backend;
>   	const char *seat_id = default_seat;
> +	const char *session_seat;
> +
> +	session_seat=getenv("XDG_SEAT");
> +	if (session_seat)
> +		seat_id=session_seat;
>   
>   	weston_log("initializing fbdev backend\n");
>   
> 



More information about the wayland-devel mailing list