Fix toolbar and menu bar getting stuck open in fullscreen after certain actions.
- Move menu bar locking into ScopedMenuBarLock to get a stronger guarantee that the menu bar is left unlocked on exiting fullscreen. - Use a different test for whether there should be a tracking area. - Lock and unlock the menu bar from -[FullscreenToolbarMouseTracker mouseEntered:] and -mouseExited: directly. Also don't remove the tracking area in mouseExited:, this caused a case where the tracking area got removed while the menu bar was still visible. - Remove a couple of unit tests which mostly repeated existing tests but also tested assumptions that are no longer valid. It might be good to add an interactive UI test in the future, or a unit test for FullscreenToolbarMouseTracker. Background ---------- The menu bar and toolbar would get stuck if you enter fullscreen and either: 1. Move the mouse to the top of the screen, then move it down over the toolbar, then back up to the top of the screen, then down to the middle of the screen. Cause: the tracking was incorrectly removed in mouseExited:. 2. Move the mouse to the top of the screen, then open a menu, move the mouse down to the middle of the screen, and click to close the menu. Cause: The menu bar overlaps the window when it drops down. Moving the mouse over the menu bar fired mouseExited:, but the old code used -mouseInsideTrackingArea, which still returned YES because the mouse was technically inside the tracking area even though mouseExited: had already fired and wouldn't fire again. Bug: 762160 Change-Id: Ia15228be8d62e16a66a712f78bd1c8fe62dbef26 Reviewed-on: https://chromium-review.googlesource.com/688414Reviewed-by:Robert Sesek <rsesek@chromium.org> Reviewed-by:
Sarah Chan <spqchan@chromium.org> Commit-Queue: Sidney San Martín <sdy@chromium.org> Cr-Commit-Position: refs/heads/master@{#505168}
Showing
Please register or sign in to comment