From b33763caeb54eb36ade62306d69cf53061628d75 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Tue, 28 Aug 2012 16:25:41 +0100 Subject: [PATCH] Fixed: popovers could only properly open relative to views in the main window. This would make the popover open with the wrong coordinates if the positioning view was in a window different than the main window, such as a utility window which can't become the main window. --- AppKit/_CPAttachedWindow.j | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/AppKit/_CPAttachedWindow.j b/AppKit/_CPAttachedWindow.j index ccbf265f1..690fa80fe 100644 --- a/AppKit/_CPAttachedWindow.j +++ b/AppKit/_CPAttachedWindow.j @@ -109,8 +109,7 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0, */ - (id)initWithContentRect:(CGRect)aFrame { - self = [self initWithContentRect:aFrame styleMask:0]; - return self; + return [self initWithContentRect:aFrame styleMask:0]; } /*! @@ -196,7 +195,7 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0, - (CGPoint)computeOriginFromRect:(CGRect)aRect ofView:(CPView)positioningView preferredEdge:(int)anEdge { - var mainWindow = [CPApp mainWindow], + var mainWindow = [positioningView window], platformWindow = [mainWindow platformWindow], nativeRect = [platformWindow nativeContentRect], baseOrigin = [positioningView convertPointToBase:aRect.origin],