Regression from f9c6dbf41832 in Bug 639705.
1. Load http://pearce.org.nz/full-screen in Firefox nightly on non-MacOSX platform
2. Ensure window is *not* maximized.
3. Press 'f' to enter fullscreen.
4. Press ESC to exit fullscreen.
5. Press 'f' to enter fullscreen.
6. Observe fullscreen exiting as soon as it enters.
Problem is here:
We're adding the "deactivate" listener |if (!this.useLionFullScreen)|, but we're removing it |if (this.useLionFullScreen)|. Currently on Windows entering fullscreen causes "deactivate" and "activate" events to be dispatched (window is lowered causing "deactivate", window is resized to fullscreen, window is raised causing "activate"), so if the listener (which is added upon first entry to fullscreen) isn't removed on fullscreen exit, entering fullscreen the second time triggers the "deactivate" listener, which kicks us out of fullscreen.
So we should be removing the "deactivate" listener |if (!this.useLionFullScreen)| rather than |if (this.useLionFullScreen)|.
Created attachment 609183 [details] [diff] [review]
See comment 0 for explanation of fix.
Bah, sorry about that. Thanks for catching & fixing!