[gnome-shell] search: Be a bit more careful in _doSearch about timeouts
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] search: Be a bit more careful in _doSearch about timeouts
- Date: Thu, 11 Sep 2014 23:51:36 +0000 (UTC)
commit 9208473e59d800a3bab83ad831d4b72b8d25503b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Sep 11 17:51:12 2014 -0600
search: Be a bit more careful in _doSearch about timeouts
js/ui/search.js | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/search.js b/js/ui/search.js
index 5798a4e..f4898df 100644
--- a/js/ui/search.js
+++ b/js/ui/search.js
@@ -470,7 +470,15 @@ const SearchResults = new Lang.Class({
this._updateSearchProgress();
+ if (this._searchTimeoutId > 0) {
+ GLib.source_remove(this._searchTimeoutId);
+ this._searchTimeoutId = 0;
+ }
+ },
+
+ _onSearchTimeout: function() {
this._searchTimeoutId = 0;
+ this._doSearch();
return GLib.SOURCE_REMOVE;
},
@@ -502,7 +510,7 @@ const SearchResults = new Lang.Class({
this._updateSearchProgress();
if (this._searchTimeoutId == 0)
- this._searchTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 150, Lang.bind(this,
this._doSearch));
+ this._searchTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 150, Lang.bind(this,
this._onSearchTimeout));
},
_onPan: function(action) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]