User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; fi; rv:188.8.131.52) Gecko/20091102 Firefox/3.5.5 Build Identifier: Mozilla/5.0 (X11;U;Linux armv6l;en-US;rv:1.9.2b5pre) Gecko/20091125 Firefox/3.6b5pre Fennec/1.0b6pre Reproducible: Always Steps to Reproduce: 1. Start to load a web page in Fennec 2. Switch to another application on N900 3. Wait till page load has ended on Fennec Actual Results: Fennec gets focus Expected Results: N900 stays in the app that the user has selected
Probably caused by http://mxr.mozilla.org/mobile-browser/source/chrome/content/browser.js#2371 . Wonder why we added that...
(In reply to comment #1) > Probably caused by > http://mxr.mozilla.org/mobile-browser/source/chrome/content/browser.js#2371 . > Wonder why we added that... I think we did it to give form controls focus in the newly loaded webpage. A lot has changed with focus since then. Maybe we can remove it.
Alternatively, there are ways to focus that content without raising the window (focusing the <browser>, I think?)
I wonder if this flag can do the work :http://hg.mozilla.org/mozilla-central/file/05fba5eb6b42/dom/interfaces/base/nsIFocusManager.idl#l186 ?
The flag didn't do it... Is there any cases where we want Fennec to raise when we call focus()? Otherwise we could default mozilla.widget.raise-on-setfocus to false
We don't want to change window.focus() behavior across the board, we just want to avoid calling it in that case. The question is whether we need to replace it with something else... what breaks if we just remove it?
Created attachment 414652 [details] [diff] [review] patch This patch simply removes the code the explicitly focuses the dom window. We originally did this to work around web content focus problems. For example, when google.com loads, it focuses the editbox. Fennec was not allowing that to happen, so we added this code. The focus code in gecko has been overhauled since then. I removed the code and the editbox at google.com was focused (and yellow) after loading. I could also start typing into the editbox with needing to tap it. Loading planet.mozilla.org (or other large web site), then switching apps did not force fennec to pop back when the page finished loading. Score this one to Neil Deakin!
(In reply to comment #6) > with something else... what breaks if we just remove it? Nothing yet...
verified FIXED on build: Mozilla/5.0 (X11; U; Linux armv7l; Nokia N900; en-US; rv:1.9.2b5pre) Gecko/20091130 Firefox/3.6b5pre Fennec/1.0b6pre