[PATCH] libweston: Support autodetection of the current XDG_SEAT
Pekka Paalanen
ppaalanen at gmail.com
Wed Aug 16 08:50:15 UTC 2017
On Tue, 15 Aug 2017 18:03:10 -0400
nerdopolis <bluescreen_avenger at verizon.net> wrote:
> On Tuesday, August 15, 2017 3:36:48 PM EDT Armin Krezović wrote:
> > 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");
> > >
> > >
> >
> >
>
> Hi
> pam_systemd.so sets the XDG_SEAT variable though
> So if you're starting Weston where the session_seat is seat1, weston
> won't start, unless you specify --seat=$XDG_SEAT
>
> Which is OK, but then login managers would need to be aware of that
> when starting Weston
Hi,
yeah, I think using XDG_SEAT by default if set would be nice, but the
command line option must override that. I didn't read the patch
carefully enough to see if it does. Probably could add a sentence in
the man page and the weston --help output too.
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170816/24be82fa/attachment-0001.sig>
More information about the wayland-devel
mailing list