mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Ensure our HTML output view is first responder after load
When redirecting to a PDF file the PDFView (inside the WebView) is not made first responder (on 10.9, it might have worked on 10.8).
This commit is contained in:
@@ -72,8 +72,24 @@ extern NSString* const kCommandRunnerURLScheme; // from HTMLOutput.h
|
||||
|
||||
// Sending goBack:/goForward: to a WebView does not call this WebFrameLoadDelegate method
|
||||
if(frame == [sender mainFrame])
|
||||
{
|
||||
[self webView:sender didClearWindowObject:[frame windowObject] forFrame:frame];
|
||||
|
||||
// This happens when we redirect to a PDF file
|
||||
if(self.window.firstResponder == self.window)
|
||||
{
|
||||
NSRect rect = [sender frame];
|
||||
for(NSView* view = [sender hitTest:NSMakePoint(NSMidX(rect), NSMidY(rect))]; view; view = [view superview])
|
||||
{
|
||||
if([view acceptsFirstResponder])
|
||||
{
|
||||
[self.window makeFirstResponder:view];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!NSEqualRects(self.pendingVisibleRect, NSZeroRect))
|
||||
[[[[self.webView mainFrame] frameView] documentView] scrollRectToVisible:self.pendingVisibleRect];
|
||||
self.pendingVisibleRect = NSZeroRect;
|
||||
|
||||
Reference in New Issue
Block a user