Bug 1320230 - When monitoring for the search popup hiding on click, use dispatchToMainThread to reset the status rather than setTimeout as it is more reliable. r?florian draft
authorMark Banner <standard8@mozilla.com>
Tue, 13 Jun 2017 23:05:15 +0100
changeset 598144 11f57cd629c757646ee394954849f5a9a26d5198
parent 598062 e49151136658c0d0f79b522727b807fd6cd8a79e
child 634421 d5cf9092edb5904f4e527293e11dc5e2c74dcec2
push id65146
push userbmo:standard8@mozilla.com
push dateWed, 21 Jun 2017 12:50:30 +0000
reviewersflorian
bugs1320230
milestone56.0a1
Bug 1320230 - When monitoring for the search popup hiding on click, use dispatchToMainThread to reset the status rather than setTimeout as it is more reliable. r?florian MozReview-Commit-ID: Gjr0UXr1Mf7
browser/components/search/content/search.xml
--- a/browser/components/search/content/search.xml
+++ b/browser/components/search/content/search.xml
@@ -1122,19 +1122,19 @@
         }
 
         // Show the current default engine in the top header of the panel.
         this.updateHeader();
       ]]></handler>
 
       <handler event="popuphiding"><![CDATA[
         this._isHiding = true;
-        setTimeout(() => {
+        Services.tm.dispatchToMainThread(() => {
           this._isHiding = false;
-        }, 0);
+        });
       ]]></handler>
 
       <!-- This handles clicks on the topmost "Foo Search" header in the
            popup (hbox[anonid="searchbar-engine"]). -->
       <handler event="click"><![CDATA[
         if (event.button == 2) {
           // Ignore right clicks.
           return;