Title: [144389] trunk/Source/WebKit2
- Revision
- 144389
- Author
- [email protected]
- Date
- 2013-02-28 15:59:11 -0800 (Thu, 28 Feb 2013)
Log Message
Add private API to disable WKView window occlusion detection
https://bugs.webkit.org/show_bug.cgi?id=111107
Patch by Kiran Muppala <[email protected]> on 2013-02-28
Reviewed by Simon Fraser.
* UIProcess/API/mac/WKView.mm:
(-[WKView _enableWindowOcclusionNotifications]): Check if occlusion
detection is enabled before enabling notifications.
(windowBecameOccluded): Ditto before changing window occlusion state.
(-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
Initialize occlusion detection enabled flag to "YES".
(-[WKView windowOcclusionDetectionEnabled]):
(-[WKView setWindowOcclusionDetectionEnabled:]):
* UIProcess/API/mac/WKViewPrivate.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (144388 => 144389)
--- trunk/Source/WebKit2/ChangeLog 2013-02-28 23:54:17 UTC (rev 144388)
+++ trunk/Source/WebKit2/ChangeLog 2013-02-28 23:59:11 UTC (rev 144389)
@@ -1,3 +1,20 @@
+2013-02-28 Kiran Muppala <[email protected]>
+
+ Add private API to disable WKView window occlusion detection
+ https://bugs.webkit.org/show_bug.cgi?id=111107
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _enableWindowOcclusionNotifications]): Check if occlusion
+ detection is enabled before enabling notifications.
+ (windowBecameOccluded): Ditto before changing window occlusion state.
+ (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
+ Initialize occlusion detection enabled flag to "YES".
+ (-[WKView windowOcclusionDetectionEnabled]):
+ (-[WKView setWindowOcclusionDetectionEnabled:]):
+ * UIProcess/API/mac/WKViewPrivate.h:
+
2013-02-28 Anders Carlsson <[email protected]>
Add the notion of an allowed connection to SessionStorageNamespace
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (144388 => 144389)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-02-28 23:54:17 UTC (rev 144388)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-02-28 23:59:11 UTC (rev 144389)
@@ -227,6 +227,7 @@
NSSize _intrinsicContentSize;
BOOL _expandsToFitContentViaAutoLayout;
BOOL _isWindowOccluded;
+ BOOL _windowOcclusionDetectionEnabled;
}
@end
@@ -2262,6 +2263,9 @@
- (void)_enableWindowOcclusionNotifications
{
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ if (![self windowOcclusionDetectionEnabled])
+ return;
+
NSWindow *window = [self window];
if (!window)
return;
@@ -2320,7 +2324,7 @@
Vector<WKView *>& allViews = [WKView _allViews];
for (size_t i = 0, size = allViews.size(); i < size; ++i) {
WKView *view = allViews[i];
- if ([[view window] windowNumber] == windowID)
+ if ([[view window] windowNumber] == windowID && [view windowOcclusionDetectionEnabled])
[view _setIsWindowOccluded:YES];
}
}
@@ -3133,6 +3137,7 @@
_data->_expandsToFitContentViaAutoLayout = NO;
_data->_intrinsicContentSize = NSMakeSize(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric);
+ _data->_windowOcclusionDetectionEnabled = YES;
[self _registerDraggedTypes];
@@ -3321,6 +3326,22 @@
return _data->_viewInWindowChangesDeferredCount;
}
+- (BOOL)windowOcclusionDetectionEnabled
+{
+ return _data->_windowOcclusionDetectionEnabled;
+}
+
+- (void)setWindowOcclusionDetectionEnabled:(BOOL)flag
+{
+ if (_data->_windowOcclusionDetectionEnabled == flag)
+ return;
+ _data->_windowOcclusionDetectionEnabled = flag;
+ if (flag)
+ [self _enableWindowOcclusionNotifications];
+ else
+ [self _disableWindowOcclusionNotifications];
+}
+
@end
@implementation WKResponderChainSink
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h (144388 => 144389)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h 2013-02-28 23:54:17 UTC (rev 144388)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h 2013-02-28 23:59:11 UTC (rev 144389)
@@ -59,4 +59,7 @@
- (void)endDeferringViewInWindowChanges;
- (BOOL)isDeferringViewInWindowChanges;
+- (BOOL)windowOcclusionDetectionEnabled;
+- (void)setWindowOcclusionDetectionEnabled:(BOOL)flag;
+
@end
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes