aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-03-12 22:43:29 +0100
committerGuido Günther <agx@sigxcpu.org>2012-03-12 22:43:29 +0100
commit2583e8a90cf50199e6cb74e0d9181ab7c0940b7b (patch)
tree0cb7bd3b0d4066ec7ea07b0a56bdcfee0d7a3ee5
parent6a58153b89dbdeff33745c226442e63d7f92c775 (diff)
Toggle keyboard by visibility
not by extra state variable.
-rw-r--r--extension.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/extension.js b/extension.js
index ac9e4de..7e25c6f 100644
--- a/extension.js
+++ b/extension.js
@@ -14,16 +14,14 @@ OnScreenKeyboardButton.prototype = {
label = GLib.markup_escape_text('Keyboard', -1);
this.actor = new St.Button ({ label: label });
this.actor.connect("clicked", Lang.bind(this, this._toggleShowOnScreenKeyboard));
- this._onScreenKeyboardShown = false;
},
_toggleShowOnScreenKeyboard: function() {
- if (this._onScreenKeyboardShown) {
+ if (Main.keyboard && Main.keyboard._visible) {
Main.keyboard.hide();
} else {
Main.keyboard.show();
}
- this._onScreenKeyboardShown = !this._onScreenKeyboardShown;
},
};