Verdi, when we spoke last week you noted that the Megabar's behaviour was inconsistent when switching in and out of the Firefox window.
Currently on Mac, if the Urlbar is in any kind of focus state and the Firefox window loses focus, we blur the Urlbar. When the window is refocused the megabar regains focus and:
- expands, if the page content was clicked
- does not expand, if browser chrome was clicked
If a keyboard shortcut was used to refocus the window, we expand unless a part of the Urlbar was selected (but not the entire thing), reflecting our current handling on mousedrags.
This is also not consistent across platforms. On Linux, we don't even focus if the window is refocused with a click on page content. I unfortunately can't test our Windows behaviour.
While all of this behaviour follows from how we expand based on various events when the Firefox window is focused, we should come up with some consistent (and cross-platform?) behaviour for window switching.