Changeset 13030 in webkit
- Timestamp:
- Feb 27, 2006 5:17:05 PM (18 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/ChangeLog
r12997 r13030 1 2006-02-27 Tim Omernick <timo@apple.com> 2 3 Reviewed by Adele. 4 5 <rdar://problem/4222043> Safari should reduce null events sent to invisible plugins 6 7 * Plugins/WebBaseNetscapePluginView.h: 8 * Plugins/WebBaseNetscapePluginView.m: 9 (-[WebBaseNetscapePluginView restartNullEvents]): 10 Check to see if the plugin view is completely obscured (scrolled out of view, for example). If it is 11 obscured and it wasn't before, or the other way around, then restart the null event timer so it can 12 fire at the appropriate rate. 13 (-[WebBaseNetscapePluginView viewHasMoved:]): 14 If a plugin is obscured, send it null events as if it were in an inactive window. 15 1 16 2006-02-26 Mitz Pettel <opendarwin.org@mitzpettel.com> 2 17 -
trunk/WebKit/Plugins/WebBaseNetscapePluginView.h
r11962 r13030 61 61 BOOL currentEventIsUserGesture; 62 62 BOOL isTransparent; 63 BOOL isCompletelyObscured; 63 64 64 65 int32 specifiedHeight; -
trunk/WebKit/Plugins/WebBaseNetscapePluginView.m
r12898 r13030 531 531 ASSERT([self window]); 532 532 533 if (nullEventTimer) {533 if (nullEventTimer) 534 534 [self stopNullEvents]; 535 } 536 537 if ([[self window] isMiniaturized]) { 535 536 if ([[self window] isMiniaturized]) 538 537 return; 539 }540 538 541 539 NSTimeInterval interval; … … 543 541 // Send null events less frequently when the actual window is not key. Also, allow the DB 544 542 // to override this behavior and send full speed events to non key windows. 545 if ([[self window] isKeyWindow] || [[self webView] _dashboardBehavior:WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns]) { 543 // If the plugin is completely obscured (scrolled out of view, for example), then we will 544 // send null events at a reduced rate. 545 if (!isCompletelyObscured && ([[self window] isKeyWindow] || [[self webView] _dashboardBehavior:WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns])) 546 546 interval = NullEventIntervalActive; 547 } else {547 else 548 548 interval = NullEventIntervalNotActive; 549 }550 549 551 550 nullEventTimer = [[NSTimer scheduledTimerWithTimeInterval:interval … … 1338 1337 [self updateAndSetWindow]; 1339 1338 [self resetTrackingRect]; 1339 1340 // Check to see if the plugin view is completely obscured (scrolled out of view, for example). 1341 // For performance reasons, we send null events at a lower rate to plugins which are obscured. 1342 BOOL oldIsObscured = isCompletelyObscured; 1343 isCompletelyObscured = NSEqualSizes([self visibleRect].size, NSZeroSize); 1344 if (isCompletelyObscured != oldIsObscured) 1345 [self restartNullEvents]; 1340 1346 } 1341 1347
Note: See TracChangeset
for help on using the changeset viewer.