Bug 135509 - WebPageProxy::viewDidEnterWindow and viewDidLeaveWindow not being executed when swapping windows
Summary: WebPageProxy::viewDidEnterWindow and viewDidLeaveWindow not being executed wh...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-08-01 09:37 PDT by Brent Fulgham
Modified: 2023-04-27 01:16 PDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2014-08-01 09:37:24 PDT
While debugging Bug 135493, I found that WebPageProxy::viewDidEnterWindow and WebPageProxy::viewDidLeaveWindow methods were not getting called when moving a WKView from one NSWindow in the UIProcess (e.g., the main application window) to the Fullscreen window (see WKFullScreenWindowController::enterFullScreen).

This seems to be happening because the window view state is coalesced such that the operation of moving from application window to fullscreen window, which should involve (1) leaving the application window, and (2) entering the Fullscreen window, is seen as a no-op by the WebPageProxy::dispatchViewStateChange.

We should probably monitor Window ID so that we can avoid combing the "leave->add" pair into a no-op so that the viewDidLeaveWindow is called on the application window, and viewDidEnterWindow is called on the Fullscreen window (and vice-versa when exiting Fullscreen).
Comment 1 Radar WebKit Bug Importer 2014-08-01 09:51:22 PDT
<rdar://problem/17885166>
Comment 2 Tim Horton 2014-08-01 10:54:09 PDT
FWIW the reason we do this coalescing is so that if you shuffle a view around in the view hierarchy of a single window, we won't go all the way to the Web process unparenting layer trees and whatnot.