[gnome-shell] keyboard: Make sure to set currentSource if we only have one source



commit 997f851031222eac76ce1cc468d57ae6be29b380
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Feb 7 03:27:55 2013 -0500

    keyboard: Make sure to set currentSource if we only have one source
    
    This way, popping up and re-closing the switcher won't emit an error
    trying to check for this._currentSource.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693303

 js/ui/status/keyboard.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js
index 47c648f..8295c1a 100644
--- a/js/ui/status/keyboard.js
+++ b/js/ui/status/keyboard.js
@@ -410,6 +410,9 @@ const InputSourceIndicator = new Lang.Class({
         let newSourceIndex = this._settings.get_uint(KEY_CURRENT_INPUT_SOURCE);
         let newSource = this._inputSources[newSourceIndex];
 
+        let oldSource;
+        [oldSource, this._currentSource] = [this._currentSource, newSource];
+
         if (!newSource || (nVisibleSources < 2 && !newSource.properties)) {
             // This source index might be invalid if we weren't able
             // to build a menu item for it, so we hide ourselves since
@@ -424,9 +427,6 @@ const InputSourceIndicator = new Lang.Class({
 
         this.actor.show();
 
-        let oldSource;
-        [oldSource, this._currentSource] = [this._currentSource, newSource];
-
         if (oldSource) {
             oldSource.menuItem.setShowDot(false);
             this._container.set_skip_paint(oldSource.indicatorLabel, true);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]