[Wayland-bugs] [Bug 738873] New: wayland backend aborts entire program if XDG_RUNTIME_DIR unset

gtk+ (bugzilla.gnome.org) bugzilla at gnome.org
Mon Oct 20 07:58:06 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=738873
  gtk+ | Backend: Wayland | unspecified

           Summary: wayland backend aborts entire program if
                    XDG_RUNTIME_DIR unset
    Classification: Platform
           Product: gtk+
           Version: unspecified
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: Backend: Wayland
        AssignedTo: gtk-bugs at gtk.org
        ReportedBy: desrt at desrt.ca
         QAContact: gtk-bugs at gtk.org
                CC: rob at robster.org.uk, wayland-bugs at lists.freedesktop.org
     GNOME version: ---


We follow the xdg spec and implement a fallback for XDG_RUNTIME_DIR (in
~/.cache) if it is unset.

Unfortunately, wayland logs an error in this case.  Our wayland log handler
then does this:

static void
log_handler(const char *format, va_list args)
{
  g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
}


which is fatal.


This happens any time someone tries to initialise wayland with XDG_RUNTIME_DIR
unset.  That can happen if DISPLAY is unset, for example (which will cause the
X11 init to fail, moving on to the next backend, which is wayland).

So we've now gone from a place where unset DISPLAY and XDG_RUNTIME_DIR used to
cause gtk_init() to fail to a place where it causes the entire program to
abort, simply because we happen to be trying wayland as a second effort.

We can fix this in some ways:

 1) only try the wayland backend if GDK_BACKEND=wayland explicitly

 2) fix libwayland not to throw an error in this case (and maybe fallback
    to ~/.cache/ in the way the spec suggests)

 3) avoid bringing up the wayland backend if XDG_RUNTIME_DIR is unset to
    avoid the certain abort that will follow

 4) log wayland messages in a less-fatal way

I'm in favour of 2.  If that's not on the table, I'd consider 3 to be the best
option.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the wayland-bugs mailing list