[gnome-shell] Remove the cursor from the search entry when it doesn't have focus
- From: Marina Zhurakhinskaya <marinaz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Remove the cursor from the search entry when it doesn't have focus
- Date: Mon, 28 Jun 2010 22:18:44 +0000 (UTC)
commit 40c7d3763bf8f3afef88f68b261e23e46d5e8839
Author: Marina Zhurakhinskaya <marinaz redhat com>
Date: Mon Jun 28 17:02:18 2010 -0400
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 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 02ff381..0693f23 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',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]