Bug 33739

Summary: Fullscreen video HUD stays on top when switching to another window (e.g. via Alt-Tab)
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, cmarrin
Priority: P2 Keywords: InRadar, PlatformOnly
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
Patch
aroben: review+
New patch aroben: review+

Description Adam Roben (:aroben) 2010-01-15 14:09:50 PST
To reproduce:

1. Go to a page with <video controls>
2. Click the fullscreen button in the video's controls
3. Switch to another window via Alt-Tab (e.g., the Safari window that contained the <video>)

The fullscreen video's HUD stays on screen, on top of whatever window you've just switched to.
Comment 1 Adam Roben (:aroben) 2010-01-15 14:15:18 PST
<rdar://problem/7547574>
Comment 2 Beth Dakin 2010-03-11 16:04:35 PST
Created attachment 50556 [details]
Patch
Comment 3 Adam Roben (:aroben) 2010-03-12 13:44:35 PST
Comment on attachment 50556 [details]
Patch

>  void FullscreenVideoController::draw()
>  {
> +    HWND foregroundWindow = GetForegroundWindow();
> +    if (foregroundWindow == m_videoWindow)
> +        createHUDWindow();
> +    else if (foregroundWindow != m_hudWindow)
> +        destroyHUDWindow();
> +

After this, I think you should assert that m_hudWindow is non-null. And maybe you should bail if it is null, in release builds.

r=me
Comment 4 Beth Dakin 2010-03-12 14:09:19 PST
Created attachment 50631 [details]
New patch

Adam and I discussed a better way to do this on IRC!
Comment 5 Adam Roben (:aroben) 2010-03-12 14:10:53 PST
Comment on attachment 50631 [details]
New patch

r=me!
Comment 6 Beth Dakin 2010-03-12 15:17:31 PST
Fixed with r55942.