gdm: hide session list if only one session

The session list is supposed to hide itself if

1) the user is already logged in
2) there is only one xsession file installed

There was a bug causing 2) not to work.
This commit fixes that bug.

https://bugzilla.gnome.org/show_bug.cgi?id=658423
This commit is contained in:
Ray Strode 2011-09-06 23:07:09 -04:00
parent 6496205081
commit 45a1ceaa54

View File

@ -580,8 +580,11 @@ function SessionList() {
SessionList.prototype = {
_init: function() {
this.actor = new St.BoxLayout({ style_class: 'login-dialog-session-list',
this.actor = new St.Bin();
this._box = new St.BoxLayout({ style_class: 'login-dialog-session-list',
vertical: true});
this.actor.child = this._box;
this._button = new St.Button({ style_class: 'login-dialog-session-list-button',
can_focus: true,
@ -606,14 +609,14 @@ SessionList.prototype = {
this._button.connect('clicked',
Lang.bind(this, this._onClicked));
this.actor.add_actor(this._button,
this._box.add_actor(this._button,
{ x_fill: true,
y_fill: true,
expand: true });
this._scrollView = new St.ScrollView({ style_class: 'login-dialog-session-list-scroll-view'});
this._scrollView.set_policy(Gtk.PolicyType.NEVER,
Gtk.PolicyType.AUTOMATIC);
this.actor.add_actor(this._scrollView,
this._box.add_actor(this._scrollView,
{ x_fill: true,
y_fill: true,
expand: true });
@ -679,9 +682,9 @@ SessionList.prototype = {
ids.sort();
if (ids.length <= 1)
this.actor.hide();
this._box.hide();
else
this.actor.show();
this._box.show();
for (let i = 0; i < ids.length; i++) {
let [sessionName, sessionDescription] = GdmGreeter.get_session_name_and_description(ids[i]);
@ -807,10 +810,9 @@ LoginDialog.prototype = {
this._promptBox.add(this._sessionList.actor,
{ expand: true,
x_fill: true,
x_fill: false,
y_fill: true,
x_align: St.Align.START,
y_align: St.Align.START});
x_align: St.Align.START });
this._promptBox.hide();
let notListedLabel = new St.Label({ text: _("Not listed?"),