On 2026-03-07 19:17:54 +0100, Andreas Metzler wrote:
> On 2026-03-07 Vincent Lefevre <[email protected]> wrote:
> > I'm wondering why you did not get an abort like me. But after ssh with
> > X11 forwarding, $XDG_SESSION_TYPE is set to "tty" instead of "x11"[*],
> > so that this changes the behavior.
>
> Because I have got XDG_SESSION_TYPE=tty since I am not using a graphical
> display manager like gdm but startx+wmaker.
OK, I suppose that pam_systemd is used at tty login time, but
not when X is started. I think that either startx or xinit
should change XDG_SESSION_TYPE to "x11", otherwise I don't
see the point of differentiating "tty" and "x11".
> The whole thing is also not trivially fixable, neither QT nor FLTK have
> a direct replacement for gtk_init_check().
I normally use VLC with its Qt interface, and when I run
env DISPLAY=:1 vlc
VLC falls back to the tty interface. This shows that there is
a solution at least for Qt.
In any case, if X11 is detected, XOpenDisplay() could be used.
It seems that this is what VLC does: modules/gui/qt/qt.cpp has
static bool HasX11( vlc_object_t *obj )
{
if( !vlc_xlib_init( obj ) )
return false;
Display *dpy = XOpenDisplay( NULL );
if( dpy == NULL )
return false;
XCloseDisplay( dpy );
return true;
}
--
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)