From 40c7d3763bf8f3afef88f68b261e23e46d5e8839 Mon Sep 17 00:00:00 2001 From: Marina Zhurakhinskaya Date: Mon, 28 Jun 2010 17:02:18 -0400 Subject: [PATCH] Remove the cursor from the search entry when it doesn't have focus We should not be showing the cursor in the search entry in the overview if the user's input will be appearing elsewhere, such as in the run dialog, in the Looking Glass console, or in the notification's response field. --- js/ui/dash.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/ui/dash.js b/js/ui/dash.js index 02ff3816d..0693f2370 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -160,11 +160,21 @@ SearchEntry.prototype = { })); this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); + global.stage.connect('notify::key-focus', Lang.bind(this, this._updateCursorVisibility)); + this.pane = null; this._capturedEventId = 0; }, + _updateCursorVisibility: function() { + let focus = global.stage.get_key_focus(); + if (focus == global.stage || focus == this.entry) + this.entry.set_cursor_visible(true); + else + this.entry.set_cursor_visible(false); + }, + show: function() { if (this._capturedEventId == 0) this._capturedEventId = global.stage.connect('captured-event',