summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/mac
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
commit8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch)
treecdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Source/WebKit2/UIProcess/mac
parent1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff)
downloadqtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Source/WebKit2/UIProcess/mac')
-rw-r--r--Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm22
1 files changed, 20 insertions, 2 deletions
diff --git a/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm b/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
index bcdfbc272..5c6c73ce2 100644
--- a/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
+++ b/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
@@ -56,6 +56,7 @@ static const CGFloat windowContentBorderThickness = 55;
@interface WKWebInspectorProxyObjCAdapter ()
- (id)initWithWebInspectorProxy:(WebInspectorProxy*)inspectorProxy;
+- (void)close;
@end
@@ -78,6 +79,11 @@ static const CGFloat windowContentBorderThickness = 55;
return self;
}
+- (void)close
+{
+ _inspectorProxy = 0;
+}
+
- (void)windowWillClose:(NSNotification *)notification
{
static_cast<WebInspectorProxy*>(_inspectorProxy)->close();
@@ -85,7 +91,16 @@ static const CGFloat windowContentBorderThickness = 55;
- (void)inspectedViewFrameDidChange:(NSNotification *)notification
{
- static_cast<WebInspectorProxy*>(_inspectorProxy)->inspectedViewFrameDidChange();
+ // Resizing the views while inside this notification can lead to bad results when entering
+ // or exiting full screen. To avoid that we need to perform the work after a delay. We only
+ // depend on this for enforcing the height constraints, so a small delay isn't terrible. Most
+ // of the time the views will already have the correct frames because of autoresizing masks.
+
+ dispatch_after(DISPATCH_TIME_NOW, dispatch_get_current_queue(), ^{
+ if (!_inspectorProxy)
+ return;
+ static_cast<WebInspectorProxy*>(_inspectorProxy)->inspectedViewFrameDidChange();
+ });
}
@end
@@ -143,6 +158,7 @@ void WebInspectorProxy::createInspectorWindow()
NSView *contentView = [window contentView];
[m_inspectorView.get() setFrame:[contentView bounds]];
+ [m_inspectorView.get() setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[contentView addSubview:m_inspectorView.get()];
// Center the window initially before setting the frame autosave name so that the window will be in a good
@@ -173,7 +189,6 @@ WebPageProxy* WebInspectorProxy::platformCreateInspectorPage()
ASSERT(m_inspectorView);
[m_inspectorView.get() setDrawsBackground:NO];
- [m_inspectorView.get() setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
m_inspectorProxyObjCAdapter.adoptNS([[WKWebInspectorProxyObjCAdapter alloc] initWithWebInspectorProxy:this]);
@@ -207,6 +222,7 @@ void WebInspectorProxy::platformDidClose()
m_inspectorView = 0;
+ [m_inspectorProxyObjCAdapter.get() close];
m_inspectorProxyObjCAdapter = 0;
}
@@ -267,6 +283,8 @@ void WebInspectorProxy::platformAttach()
NSRect inspectedViewFrame = [inspectedView frame];
[m_inspectorView.get() setFrame:NSMakeRect(NSMinX(inspectedViewFrame), 0, NSWidth(inspectedViewFrame), inspectorPageGroup()->preferences()->inspectorAttachedHeight())];
+ [m_inspectorView.get() setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin];
+
// Start out hidden if we are not visible yet. When platformOpen is called, hidden will be set to NO.
[m_inspectorView.get() setHidden:!m_isVisible];