summaryrefslogtreecommitdiff
path: root/frontends/cocoa/ArrowWindow.m
diff options
context:
space:
mode:
authorSven Weidauer <sven@5sw.de>2017-06-05 10:47:34 +0200
committerSven Weidauer <sven@5sw.de>2017-06-05 10:51:19 +0200
commit3ee40a10b123c36be3e29602767840a7a71aaafa (patch)
tree64123d0bf6a6cf5a5a4c1fd8349756db68e09483 /frontends/cocoa/ArrowWindow.m
parentce4e059ea67cee7f35b4b810a4387f343fa74650 (diff)
downloadnetsurf-3ee40a10b123c36be3e29602767840a7a71aaafa.tar.gz
netsurf-3ee40a10b123c36be3e29602767840a7a71aaafa.tar.bz2
Fix up cocoa frontend.
- Convert to ARC - Fix crash due to endless responder chain recursion - Update makefile to find openssl installed via home-brew - Fix most compiler warnings
Diffstat (limited to 'frontends/cocoa/ArrowWindow.m')
-rw-r--r--frontends/cocoa/ArrowWindow.m13
1 files changed, 6 insertions, 7 deletions
diff --git a/frontends/cocoa/ArrowWindow.m b/frontends/cocoa/ArrowWindow.m
index 8edc32e9f..84dbe1ef7 100644
--- a/frontends/cocoa/ArrowWindow.m
+++ b/frontends/cocoa/ArrowWindow.m
@@ -28,9 +28,9 @@
@synthesize acceptsKey;
-- (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag
+- (id) initWithContentRect: (NSRect)contentRect styleMask: (NSWindowStyleMask)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag
{
- if ((self = [super initWithContentRect: contentRect styleMask: NSBorderlessWindowMask backing: bufferingType defer: flag]) == nil) {
+ if ((self = [super initWithContentRect: contentRect styleMask: NSWindowStyleMaskBorderless backing: bufferingType defer: flag]) == nil) {
return nil;
}
@@ -54,13 +54,12 @@
box = [[ArrowBox alloc] initWithFrame: NSZeroRect];
[box setArrowEdge: ArrowTopEdge];
[super setContentView: box];
- [box release];
}
[box addSubview: content];
NSRect frame = [self contentRectForFrameRect: [self frame]];
- frame.origin = [self convertScreenToBase: frame.origin];
+ frame.origin = [self convertRectFromScreen: (CGRect){.origin = frame.origin}].origin;
frame = [box convertRect: frame fromView: nil];
[content setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
@@ -73,7 +72,7 @@
frame.size = aSize;
frame = [box convertRect: frame toView: nil];
- frame.origin = [self convertBaseToScreen: frame.origin];
+ frame.origin = [self convertRectToScreen: (CGRect){.origin = frame.origin}].origin;
frame = [self frameRectForContentRect: frame];
[self setFrame: frame display: YES];
@@ -97,7 +96,7 @@ static const CGFloat padding = 0;
return NSInsetRect( contentRect, offset, offset );
}
-+ (NSRect) frameRectForContentRect: (NSRect)cRect styleMask: (NSUInteger)aStyle
++ (NSRect) frameRectForContentRect: (NSRect)cRect styleMask: (NSWindowStyleMask)aStyle
{
const CGFloat DefaultArrowSize = 15;
const CGFloat offset = -2 * (padding + DefaultArrowSize);
@@ -144,7 +143,7 @@ static NSRect ScreenRectForView( NSView *view )
{
NSRect viewRect = [view bounds]; // in View coordinate system
viewRect = [view convertRect: viewRect toView: nil]; // translate to window coordinates
- viewRect.origin = [[view window] convertBaseToScreen: viewRect.origin]; // translate to screen coordinates
+ viewRect.origin = [[view window] convertRectToScreen: (CGRect){.origin = viewRect.origin}].origin; // translate to screen coordinates
return viewRect;
}