Title: [146673] trunk/Source/WebKit2
Revision
146673
Author
[email protected]
Date
2013-03-22 16:12:36 -0700 (Fri, 22 Mar 2013)

Log Message

After switching to another space and back, video races to catch up with audio
https://bugs.webkit.org/show_bug.cgi?id=113006

Reviewed by Anders Carlsson.

Add an observer for the NSWorkspaceActiveSpaceDidChangeNotification notification, and trigger
a visibility update when that notification is observed.

* UIProcess/API/mac/WKView.mm:
(-[WKView dealloc]): Unregister the observer.
(-[WKView _activeSpaceDidChange:]): Notify the view that its visibility may have changed.
(-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]): Add the observer.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (146672 => 146673)


--- trunk/Source/WebKit2/ChangeLog	2013-03-22 23:11:59 UTC (rev 146672)
+++ trunk/Source/WebKit2/ChangeLog	2013-03-22 23:12:36 UTC (rev 146673)
@@ -1,3 +1,18 @@
+2013-03-21  Jer Noble  <[email protected]>
+
+        After switching to another space and back, video races to catch up with audio
+        https://bugs.webkit.org/show_bug.cgi?id=113006
+
+        Reviewed by Anders Carlsson.
+
+        Add an observer for the NSWorkspaceActiveSpaceDidChangeNotification notification, and trigger
+        a visibility update when that notification is observed.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView dealloc]): Unregister the observer.
+        (-[WKView _activeSpaceDidChange:]): Notify the view that its visibility may have changed.
+        (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]): Add the observer.
+
 2013-03-21  Geoffrey Garen  <[email protected]>
 
         Added a setting for whether _javascript_ markup is enabled

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (146672 => 146673)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-03-22 23:11:59 UTC (rev 146672)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-03-22 23:12:36 UTC (rev 146673)
@@ -281,6 +281,9 @@
     Vector<WKView *>& allViews = [WKView _allViews];
     allViews.remove(allViews.find(self));
 
+    NSNotificationCenter* workspaceNotificationCenter = [[NSWorkspace sharedWorkspace] notificationCenter];
+    [workspaceNotificationCenter removeObserver:self name:NSWorkspaceActiveSpaceDidChangeNotification object:nil];
+
     WebContext::statistics().wkViewCount--;
 
     [super dealloc];
@@ -2134,6 +2137,11 @@
         drawingArea->colorSpaceDidChange();
 }
 
+- (void)_activeSpaceDidChange:(NSNotification *)notification
+{
+    _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
+}
+
 - (void)_accessibilityRegisterUIProcessTokens
 {
     // Initialize remote accessibility when the window connection has been established.
@@ -3161,6 +3169,9 @@
 
     WebContext::statistics().wkViewCount++;
 
+    NSNotificationCenter* workspaceNotificationCenter = [[NSWorkspace sharedWorkspace] notificationCenter];
+    [workspaceNotificationCenter addObserver:self selector:@selector(_activeSpaceDidChange:) name:NSWorkspaceActiveSpaceDidChangeNotification object:nil];
+
     return self;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to