Changeset 70499 in webkit
- Timestamp:
- Oct 25, 2010 3:59:14 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r70496 r70499 1 2010-10-25 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Update the fake Carbon window when the window frame changes 6 https://bugs.webkit.org/show_bug.cgi?id=48273 7 8 * UIProcess/API/mac/WKView.mm: 9 (screenForWindow): 10 (-[WKView _updateWindowFrame]): 11 Pass the window frame in Carbon coordinates. 12 13 * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: 14 (WebKit::NetscapePlugin::windowFrameChanged): 15 Update the window bounds. 16 17 * WebProcess/Plugins/PluginView.cpp: 18 (WebKit::PluginView::setWindowFrame): 19 Call the plug-in. 20 21 (WebKit::PluginView::platformLayer): 22 Fix a crash when WebCore asked for the layer before it was initialized. 23 1 24 2010-10-25 Oliver Hunt <oliver@apple.com> 2 25 -
trunk/WebKit2/UIProcess/API/mac/WKView.mm
r70357 r70499 409 409 } 410 410 411 static NSScreen *screenForWindow(NSWindow *window) 412 { 413 if (NSScreen *screen = [window screen]) // nil if the window is off-screen 414 return screen; 415 416 NSArray *screens = [NSScreen screens]; 417 if ([screens count] > 0) 418 return [screens objectAtIndex:0]; // screen containing the menubar 419 420 return nil; 421 } 422 411 423 - (void)_updateWindowFrame 412 424 { 413 ASSERT([self window]); 414 415 _data->_page->updateWindowFrame(enclosingIntRect([[self window] frame])); 425 NSWindow *window = [self window]; 426 ASSERT(window); 427 428 // We want the window frame in Carbon coordinates, so flip the Y coordinate. 429 NSRect windowFrame = [window frame]; 430 NSScreen *screen = ::screenForWindow(window); 431 windowFrame.origin.y = NSMaxY([screen frame]) - windowFrame.origin.y; 432 433 _data->_page->updateWindowFrame(enclosingIntRect(windowFrame)); 416 434 } 417 435 -
trunk/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
r70347 r70499 603 603 } 604 604 605 void NetscapePlugin::windowFrameChanged(const IntRect&) 606 { 607 // FIXME: Implement. 605 void NetscapePlugin::windowFrameChanged(const IntRect& windowFrame) 606 { 607 switch (m_eventModel) { 608 case NPEventModelCocoa: 609 // Nothing to do. 610 break; 611 612 case NPEventModelCarbon: { 613 Rect bounds; 614 bounds.top = windowFrame.y() + windowFrame.height(); 615 bounds.left = windowFrame.x(); 616 bounds.right = windowFrame.right(); 617 bounds.bottom = windowFrame.y(); 618 619 ::SetWindowBounds(windowRef(), kWindowStructureRgn, &bounds); 620 break; 621 } 622 623 default: 624 ASSERT_NOT_REACHED(); 625 } 608 626 } 609 627 -
trunk/WebKit2/WebProcess/Plugins/PluginView.cpp
r69808 r70499 340 340 if (!m_plugin) 341 341 return; 342 343 // FIXME: Implement.342 343 m_plugin->windowFrameChanged(windowFrame); 344 344 } 345 345 … … 399 399 PlatformLayer* PluginView::platformLayer() const 400 400 { 401 // The plug-in can be null here if it failed to initialize or hasn't yet been initialized. 402 if (!m_plugin) 403 return 0; 404 401 405 return m_plugin->pluginLayer(); 402 406 }
Note: See TracChangeset
for help on using the changeset viewer.