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:
parent
6496205081
commit
45a1ceaa54
@ -580,8 +580,11 @@ function SessionList() {
|
|||||||
|
|
||||||
SessionList.prototype = {
|
SessionList.prototype = {
|
||||||
_init: function() {
|
_init: function() {
|
||||||
this.actor = new St.BoxLayout({ style_class: 'login-dialog-session-list',
|
this.actor = new St.Bin();
|
||||||
vertical: true});
|
|
||||||
|
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',
|
this._button = new St.Button({ style_class: 'login-dialog-session-list-button',
|
||||||
can_focus: true,
|
can_focus: true,
|
||||||
@ -606,17 +609,17 @@ SessionList.prototype = {
|
|||||||
|
|
||||||
this._button.connect('clicked',
|
this._button.connect('clicked',
|
||||||
Lang.bind(this, this._onClicked));
|
Lang.bind(this, this._onClicked));
|
||||||
this.actor.add_actor(this._button,
|
this._box.add_actor(this._button,
|
||||||
{ x_fill: true,
|
{ x_fill: true,
|
||||||
y_fill: true,
|
y_fill: true,
|
||||||
expand: true });
|
expand: true });
|
||||||
this._scrollView = new St.ScrollView({ style_class: 'login-dialog-session-list-scroll-view'});
|
this._scrollView = new St.ScrollView({ style_class: 'login-dialog-session-list-scroll-view'});
|
||||||
this._scrollView.set_policy(Gtk.PolicyType.NEVER,
|
this._scrollView.set_policy(Gtk.PolicyType.NEVER,
|
||||||
Gtk.PolicyType.AUTOMATIC);
|
Gtk.PolicyType.AUTOMATIC);
|
||||||
this.actor.add_actor(this._scrollView,
|
this._box.add_actor(this._scrollView,
|
||||||
{ x_fill: true,
|
{ x_fill: true,
|
||||||
y_fill: true,
|
y_fill: true,
|
||||||
expand: true });
|
expand: true });
|
||||||
this._itemList = new St.BoxLayout({ style_class: 'login-dialog-session-item-list',
|
this._itemList = new St.BoxLayout({ style_class: 'login-dialog-session-item-list',
|
||||||
vertical: true });
|
vertical: true });
|
||||||
this._scrollView.add_actor(this._itemList,
|
this._scrollView.add_actor(this._itemList,
|
||||||
@ -679,9 +682,9 @@ SessionList.prototype = {
|
|||||||
ids.sort();
|
ids.sort();
|
||||||
|
|
||||||
if (ids.length <= 1)
|
if (ids.length <= 1)
|
||||||
this.actor.hide();
|
this._box.hide();
|
||||||
else
|
else
|
||||||
this.actor.show();
|
this._box.show();
|
||||||
|
|
||||||
for (let i = 0; i < ids.length; i++) {
|
for (let i = 0; i < ids.length; i++) {
|
||||||
let [sessionName, sessionDescription] = GdmGreeter.get_session_name_and_description(ids[i]);
|
let [sessionName, sessionDescription] = GdmGreeter.get_session_name_and_description(ids[i]);
|
||||||
@ -806,11 +809,10 @@ LoginDialog.prototype = {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
this._promptBox.add(this._sessionList.actor,
|
this._promptBox.add(this._sessionList.actor,
|
||||||
{ expand: true,
|
{ expand: true,
|
||||||
x_fill: true,
|
x_fill: false,
|
||||||
y_fill: true,
|
y_fill: true,
|
||||||
x_align: St.Align.START,
|
x_align: St.Align.START });
|
||||||
y_align: St.Align.START});
|
|
||||||
this._promptBox.hide();
|
this._promptBox.hide();
|
||||||
|
|
||||||
let notListedLabel = new St.Label({ text: _("Not listed?"),
|
let notListedLabel = new St.Label({ text: _("Not listed?"),
|
||||||
|
Loading…
Reference in New Issue
Block a user