Skip to content

Commit 0bfdcfa

Browse files
committed
unlockDialog: Update layout indicator visibility when the screensaver
is activated. The UnlockDialog is created at startup, but the user can add/remove layouts, which should update the password entry icon.
1 parent 58e1c47 commit 0bfdcfa

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

js/ui/screensaver/screenShield.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ var ScreenShield = GObject.registerClass({
303303
return;
304304
}
305305

306+
this._dialog._updateLayoutIndicator();
306307
this._dialog.opacity = 0;
307308
this._dialog.show();
308309

js/ui/screensaver/unlockDialog.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,20 @@ class UnlockDialog extends St.BoxLayout {
102102
this._messageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
103103
passwordBox.add_child(this._messageLabel);
104104

105-
this._sourceChangedId = 0;
106105
this._inputSourceManager = KeyboardManager.getInputSourceManager();
107106
this._systemSourceIndex = null;
108107

109-
if (this._inputSourceManager.multipleSources) {
110-
this._updateLayoutIndicator();
111-
this._passwordEntry.connect('primary-icon-clicked', () => {
112-
let currentIndex = this._inputSourceManager.currentSource.index;
113-
let nextIndex = (currentIndex + 1) % this._inputSourceManager.numInputSources;
114-
this._inputSourceManager.activateInputSourceIndex(nextIndex);
115-
});
108+
this._updateLayoutIndicator();
109+
this._passwordEntry.connect('primary-icon-clicked', () => {
110+
if (!this._inputSourceManager.multipleSources)
111+
return;
112+
let currentIndex = this._inputSourceManager.currentSource.index;
113+
let nextIndex = (currentIndex + 1) % this._inputSourceManager.numInputSources;
114+
this._inputSourceManager.activateInputSourceIndex(nextIndex);
115+
});
116116

117-
this._sourceChangedId = this._inputSourceManager.connect(
118-
'current-source-changed', this._updateLayoutIndicator.bind(this));
119-
}
117+
this._sourceChangedId = this._inputSourceManager.connect(
118+
'current-source-changed', this._updateLayoutIndicator.bind(this));
120119

121120
this._buttonLayout = new St.Widget({
122121
style_class: 'dialog-button-box',
@@ -237,6 +236,11 @@ class UnlockDialog extends St.BoxLayout {
237236
}
238237

239238
_updateLayoutIndicator() {
239+
if (!this._inputSourceManager.multipleSources) {
240+
this._passwordEntry.set_primary_icon(null);
241+
return;
242+
}
243+
240244
let source = this._inputSourceManager.currentSource;
241245
if (!source)
242246
return;

0 commit comments

Comments
 (0)