Does not work in non-Unity DEs/Xsessions

Bug #1302852 reported by Sergey "Shnatsel" Davidoff on 2014-04-04
46
This bug affects 8 people
Affects Status Importance Assigned to Milestone
indicator-session (Ubuntu)
Low
Unassigned

Bug Description

Clicking any of the actions that require a prompt - shutdown, restart, etc. - in a non-Unity X session do not work. This seems to be caused by prompt selection code in https://bazaar.launchpad.net/~indicator-applet-developers/indicator-session/trunk.14.04/view/head:/src/backend-dbus/actions.c#L94 - it always assumes that Unity prompt is available even if it, in fact, is not.
Checking for availability of Zenity prompt first is reported to fix this.

For a proper solution the code responsible for detecting Unity prompt availability should be improved. Right now it seems to be simply checking if it can access D-bus. I assume the prompt is invoked via a D-bus call so I've investigated checking for name presence on the bus, but that can potentially be slow since it has a manually-set timeout.
Checking the XDG_CURRENT_DESKTOP variable and only showing the Unity prompt if it's set to "Unity" sounds like a better idea to me, but I'm not sure if the variable is set on Ubuntu Touch at all.

no longer affects: indicator-session
Changed in indicator-session (Ubuntu):
importance: Undecided → Low
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in indicator-session (Ubuntu):
status: New → Confirmed
Sebastien Bacher (seb128) wrote :

the code doesn't really assume that the Unity prompt is available

" if ((prompt == PROMPT_NONE) && p && p->end_session_dialog)
        {
          GDBusProxy * proxy = G_DBUS_PROXY (p->end_session_dialog);
          char * name = g_dbus_proxy_get_name_owner (proxy);
          if (name != NULL)
            prompt = PROMPT_WITH_UNITY;
          g_free (name);
        }

      /* can we use zenity? */
      if ((prompt == PROMPT_NONE) && p && p->zenity)
        prompt = PROMPT_WITH_ZENITY;"

name should be null if unity is not active (is not on the bus) and it should hit the second case and go with zenity...

tags: added: zesty
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers