Permalink
Browse files

Fixed: popovers could only properly open relative to views in the mai…

…n 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.
  • Loading branch information...
1 parent 5b19c96 commit b33763caeb54eb36ade62306d69cf53061628d75 @aljungberg aljungberg committed Aug 28, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 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],

0 comments on commit b33763c

Please sign in to comment.