unity-greeter default selected session icon (ubuntu) does not reflect the default that is in lightdm

Bug #978428 reported by Matt Fischer on 2012-04-10
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Unity Greeter
Fix Released
Undecided
Unassigned
unity-greeter (Ubuntu)
Low
Michael Terry
Precise
Low
Unassigned

Bug Description

I have an image where I've modified lightdm.conf to change the default session (user-session=) to something other than Ubuntu. When that image boots, before anyone has logged in, the Unity Greeter shows the session icon as Ubuntu. When I login it is running the correct session, just the icon is showing that the incorrect session has been chosen. To repro this, make a new session file or set the default to something like gnome in lightdm.conf.

My guess is that the code that picks the icon to show isn't checking what the default session is when the user has not previously logged in.

Matt Fischer (mfisch) on 2012-04-10
summary: - unity-greeter default selected session (unity) does not reflect the
- default that is in lightdm
+ unity-greeter default selected session icon (ubuntu) does not reflect
+ the default that is in lightdm
Matt Fischer (mfisch) wrote :

I poked through the code some and here are my findings:

The greeter gets the default session from here:
src/unity-greeter.vala: user_list.default_session = greeter.default_session_hint;

When I use GI in python, I always get None for that hint, whether it's in a VM or on my precise-based dev box. The other hints work fine:

Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import LightDM
>>> g = LightDM.Greeter()
>>> print g.get_default_session_hint()
None
>>> print g.get_hide_users_hint()
False

So I'm starting to think that perhaps the hint is not set properly. I know that user-session is being properly read from the config file, else the session I set wouldn't be running. I don't understand the interaction between the user's preference (last session) and the default session from the config file to make a reasonable stab at a fix at this time.

Matt Fischer (mfisch) wrote :

I should add that there are two places where the default-session hint is set:

src/display.c: greeter_set_hint (display->priv->greeter, "default-session", display->priv->user_session);

What I don't see is the relationship between the user-session value in the config file and that setting of the hint. The only time that display->priv->user_session is set is when the user selects a new session inside this code:

display_set_user_session (Display *display, const gchar *session_name) {
...
    display->priv->user_session = g_strdup (session_name);
}

And that code only gets called when a session other than default is requested.

Matt Fischer (mfisch) wrote :

First sentence of comment #2 should have said "one place" not "two".

Michael Terry (mterry) wrote :

Using GI isn't going to work outside of a launched greeter. i don't believe the communication between the daemon and greeter can happen without the daemon setting things up. So that might be a red herring.

And for where it gets set:

lightdm.c: config_set_string()
lightdm.c: seat_set_property ()
seat.c: display_set_user_session ()
display.c: greeter_set_hint ()

Matt Fischer (mfisch) wrote :

I can only repro this when I have the user list hidden:

greeter-hide-users=true

Matt Fischer (mfisch) wrote :

Per discussion with Michael Terry on IRC, the issue is that the default-session didn't act like a property, so when it was changed after the hint was read, the UI wasn't udpating. We tested this fix, which Michael will merge in:

+++ unity-greeter-0.2.8/src/user-list.vala 2012-04-26 14:03:27.276021240 -0400
@@ -179,7 +179,20 @@
         }
     }

- public string default_session = "ubuntu";
+
+ private string? _default_session = "ubuntu";
+ public string? default_session
+ {
+ get
+ {
+ return _default_session;
+ }
+ set
+ {
+ _default_session = value;
+ session_image.set_from_pixbuf (get_badge ());
+ }
+ }

     private string? _session = null;
     public string? session

Michael Terry (mterry) on 2012-04-26
Changed in unity-greeter (Ubuntu):
assignee: nobody → Michael Terry (mterry)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-greeter - 0.2.8-0ubuntu2

---------------
unity-greeter (0.2.8-0ubuntu2) quantal; urgency=low

  * debian/patches/recognize-kde-plasma.patch:
    - Recognize the "kde-plasma" session as "kde" so it gets a properly
      branded icon in the greeter. LP: #986339
  * debian/patches/show-changed-default-badge.patch:
    - When the default session is changed in lightdm.conf, don't still
      show the Ubuntu badge. LP: #978428
  * debian/patches/fix-hung-logging-in.patch:
    - Sometimes users will get stuck on a "Logging in..." screen. This
      fixes that by ensuring that we don't wait for a background to fade
      in that never will. LP: #986967
 -- Michael Terry <email address hidden> Fri, 20 Apr 2012 14:51:06 -0400

Changed in unity-greeter (Ubuntu):
status: New → Fix Released

Hello Matt, or anyone else affected,

Accepted unity-greeter into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in unity-greeter (Ubuntu Precise):
status: New → Fix Committed
tags: added: verification-needed
Sebastien Bacher (seb128) wrote :

Hey Matt, is there any chance you could test the updated version?

Changed in unity-greeter (Ubuntu Precise):
importance: Undecided → Low
Changed in unity-greeter (Ubuntu):
importance: Undecided → Low
Matt Fischer (mfisch) wrote :

Bug is fixed with unity-greeter (0.2.8-0ubuntu2)

Michael Terry (mterry) on 2012-05-15
tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-greeter - 0.2.8-0ubuntu1.1

---------------
unity-greeter (0.2.8-0ubuntu1.1) precise-proposed; urgency=low

  * debian/patches/recognize-kde-plasma.patch:
    - Recognize the "kde-plasma" session as "kde" so it gets a properly
      branded icon in the greeter. LP: #986339
  * debian/patches/show-changed-default-badge.patch:
    - When the default session is changed in lightdm.conf, don't still
      show the Ubuntu badge. LP: #978428
  * debian/patches/fix-hung-logging-in.patch:
    - Sometimes users will get stuck on a "Logging in..." screen. This
      fixes that by ensuring that we don't wait for a background to fade
      in that never will. LP: #986967
 -- Michael Terry <email address hidden> Fri, 20 Apr 2012 14:51:06 -0400

Changed in unity-greeter (Ubuntu Precise):
status: Fix Committed → Fix Released
Kane York (kanepyork) on 2012-05-16
Changed in unity-greeter:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers