@@ -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