Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/windowObserver.js

Issue 9318048: When applying to windows on install, use front-to-back order (seebug 819561) (Closed)
Patch Set: Created Feb. 4, 2013, 7:44 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/windowObserver.js
===================================================================
--- a/lib/windowObserver.js
+++ b/lib/windowObserver.js
@@ -30,17 +30,22 @@ exports.WindowObserver = WindowObserver;
* and "end" (default) means to wait until the "load" event.
* @constructor
*/
function WindowObserver(listener, when)
{
this._listener = listener;
this._when = when;
- let e = Services.ww.getWindowEnumerator();
+ let e = Services.wm.getZOrderDOMWindowEnumerator(null, true);
+ if (!e.hasMoreElements())
+ {
+ // On Linux the list returned will be empty, see bug 156333. Fall back to random order.
+ e = Services.wm.getEnumerator(null);
+ }
while (e.hasMoreElements())
{
let window = e.getNext().QueryInterface(Ci.nsIDOMWindow);
if (when == "start" || window.document.readyState == "complete")
this._listener.applyToWindow(window);
else
this.observe(window, "chrome-document-global-created", null);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld