Merge lp:~sacridex/ubuntu/precise/unity-greeter/purple-background-on-startup-fix into lp:ubuntu/precise/unity-greeter

Proposed by Philipp
Status: Work in progress
Proposed branch: lp:~sacridex/ubuntu/precise/unity-greeter/purple-background-on-startup-fix
Merge into: lp:ubuntu/precise/unity-greeter
Diff against target: 49 lines (+7/-3)
3 files modified
src/background.vala (+1/-0)
src/main-window.vala (+5/-2)
src/user-list.vala (+1/-1)
To merge this branch: bzr merge lp:~sacridex/ubuntu/precise/unity-greeter/purple-background-on-startup-fix
Reviewer Review Type Date Requested Status
Michael Terry Needs Fixing
Bryce Harrington patch Approve
Robert Ancell Pending
Ubuntu branches Pending
Review via email: mp+102679@code.launchpad.net

Description of the change

I think there is no synchronisation issue.
But there is too much stuff to be done between the initial background color and the actual background image is drawn.
There are 2 things that take longer than 0.2 seconds: launching Canberra and playing the startup sound takes about 0.26 seconds and LightDM.get_layout () (line 81 in menubar.vala) takes about 0.20 seconds.
So there was about a half second gap between those two backgrounds, unfotunately a ~0.1 second gap still remains.

The fact that the standard purple image is loaded at all, is a problem caused by appending the *other user to the user_list(which is the first user added, so the purple image is drawn) and then removing it later(which triggers a background redraw of the actual image).
But still, unity-greeter will fade from the initial background color to the actual background image, because the fade time is set and i am not able to disable it and reset it later. :(
But in my opinion that is no problem, the fade in actually looks nice.

I disabled canberra and loaded the LightDM standard layout earlier. Also i made the Guest background image relying on the Gsettings value of LightDM User.
Unfortunately there is no more background image for the *other user, otherwise this image would be drawn(as described above).

===============
Another UPDATE:
I reverted all the KeyFile parts.

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

The diff is showing some unfinished merge work in background.vala.

review: Needs Fixing (code)
Revision history for this message
Philipp (sacridex) wrote :

Dont be surprised by the Undecided/Invalid bug status it is linked to. Thats the wrong one actually. The bug is referred to unity-greeter not lightdm, thats why. If you click on the link to it, you will see.

Revision history for this message
Michael Terry (mterry) wrote :

We don't want to move back to keyfiles for the configuration. We used to have that, but switched to gsettings to make it easier for derivatives to change values. (i.e. we're optimizing ease-of-changes for derivatives, not the user)

review: Needs Fixing
35. By Philipp

* reverted all the KeyFile stuff
* the only change now is that the standard purple image is no longer shown before the user background image is shown

Revision history for this message
Bryce Harrington (bryce) wrote :

I don't know vala very well so can't comment on the quality of the code, but the patch looks clean now.

review: Approve (patch)
Revision history for this message
Michael Terry (mterry) wrote :

Just coming back to this. Why is default_background_image only used for the guest account? What about users that don't have a background set?

Revision history for this message
Philipp (sacridex) wrote :

Because the guest account has no image.
If a user has no background(which I think is impossible, but who knows), the default_background is used(background.vala:447). This is the backgroundcolor set for the lightdm user(background.vala:230).
So the guest account has a background image after all, and not just the background color.

But thinking about it now, it would be a better solution, not to put the "*other" user into the user_list at first(user-list.vala:257), but checking if there are any users in the user_list, after the real users have been added to the user_list(if not, then put "*other" to the user_list).

Revision history for this message
Michael Terry (mterry) wrote :

But it is possible and common for users not to have a set background (either they use a private image that the greeter doesn't have access to or encrypted home directories or the like).

So we need to do the same logic for them that we do for the *other user.

review: Needs Fixing
Revision history for this message
Sebastien Bacher (seb128) wrote :

ideally the merge request should be retargetted to an active serie as well, either precise-proposed or quantal

Unmerged revisions

35. By Philipp

* reverted all the KeyFile stuff
* the only change now is that the standard purple image is no longer shown before the user background image is shown

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/background.vala'
--- src/background.vala 2012-04-18 17:21:34 +0000
+++ src/background.vala 2012-04-24 17:39:18 +0000
@@ -228,6 +228,7 @@
228 }228 }
229229
230 public string default_background {get; set; default = UGSettings.get_string (UGSettings.KEY_BACKGROUND_COLOR);}230 public string default_background {get; set; default = UGSettings.get_string (UGSettings.KEY_BACKGROUND_COLOR);}
231 public string default_background_image {get; set; default = "";}
231 public string? current_background {get; set; default = null;}232 public string? current_background {get; set; default = null;}
232 public bool draw_grid {get; set; default = true;}233 public bool draw_grid {get; set; default = true;}
233 public double alpha {get; private set; default = 1.0;}234 public double alpha {get; private set; default = 1.0;}
234235
=== modified file 'src/main-window.vala'
--- src/main-window.vala 2012-04-18 17:21:34 +0000
+++ src/main-window.vala 2012-04-24 17:39:18 +0000
@@ -37,7 +37,9 @@
37 add_accel_group (accel_group);37 add_accel_group (accel_group);
3838
39 var bg_color = Gdk.RGBA ();39 var bg_color = Gdk.RGBA ();
40 bg_color.parse (UGSettings.get_string (UGSettings.KEY_BACKGROUND_COLOR));40 if (!bg_color.parse (UGSettings.get_string (UGSettings.KEY_BACKGROUND_COLOR)))
41 /* backup color hardcoded for the worst case(UGSettings key is no parseable color) */
42 bg_color.parse ("#2C001E");
41 override_background_color (Gtk.StateFlags.NORMAL, bg_color);43 override_background_color (Gtk.StateFlags.NORMAL, bg_color);
42 get_accessible ().set_name (_("Login Screen"));44 get_accessible ().set_name (_("Login Screen"));
43 has_resize_grip = false;45 has_resize_grip = false;
@@ -46,7 +48,8 @@
46 realize ();48 realize ();
47 background = new Background (Gdk.cairo_create (get_window ()).get_target ());49 background = new Background (Gdk.cairo_create (get_window ()).get_target ());
48 background.draw_grid = UGSettings.get_boolean (UGSettings.KEY_DRAW_GRID);50 background.draw_grid = UGSettings.get_boolean (UGSettings.KEY_DRAW_GRID);
49 background.default_background = UGSettings.get_string (UGSettings.KEY_BACKGROUND);51 /* Only default_background_image ist set here, not default_background(otherwise the default_background callback would trigger) */
52 background.default_background_image = UGSettings.get_string (UGSettings.KEY_BACKGROUND);
50 background.set_logo (UGSettings.get_string (UGSettings.KEY_LOGO), UGSettings.get_string (UGSettings.KEY_BACKGROUND_LOGO));53 background.set_logo (UGSettings.get_string (UGSettings.KEY_LOGO), UGSettings.get_string (UGSettings.KEY_BACKGROUND_LOGO));
51 background.show ();54 background.show ();
52 add (background);55 add (background);
5356
=== modified file 'src/user-list.vala'
--- src/user-list.vala 2012-04-18 17:21:34 +0000
+++ src/user-list.vala 2012-04-24 17:39:18 +0000
@@ -77,7 +77,7 @@
77 {77 {
78 _offer_guest = value;78 _offer_guest = value;
79 if (value)79 if (value)
80 add_entry ("*guest", _("Guest Session"));80 add_entry ("*guest", _("Guest Session"), background.default_background_image);
81 else81 else
82 remove_entry ("*guest");82 remove_entry ("*guest");
83 }83 }

Subscribers

People subscribed via source and target branches

to all changes: