Skip to content

A .desktop file without Type key will be launched at startup but won't appear in Session and Startup

In the xfae_item_new function at https://gitlab.xfce.org/xfce/xfce4-session/-/blob/master/settings/xfae-model.c#L660

      /* verify that we have an application here */
      value = xfce_rc_read_entry (rc, "Type", NULL);
      if (G_LIKELY (value != NULL
          && g_ascii_strcasecmp (value, "Application") == 0))
        {
          ...
        }
      else
        {
          return NULL;
        }

A .desktop file must set Type=Application to be appeared in the Application Autostart tab of the Session and Startup.

But in the xfsm_launch_desktop_files_on_run_hook function at https://gitlab.xfce.org/xfce/xfce4-session/-/blob/master/xfce4-session/xfsm-global.c#L373

      /* check the "Type" key */
      type = xfce_rc_read_entry (rc, "Type", NULL);
      if (G_UNLIKELY (!skip && type != NULL && g_ascii_strcasecmp (type, "Application") != 0))
        {
          skip = TRUE;
          xfsm_verbose ("Type == Application, skipping\n");
        }

If a .desktop file doesn't have a Type key, it can still pass the check and get launched.

Edited by Xu Zhen