summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2017-03-26 21:46:28 +0200
committerAkemi <der.richter@gmx.de>2017-08-18 19:47:47 +0200
commit344b75f52da349ab293ee2bb7f48604eabcffb0f (patch)
treefe93986060a65603b51949ccd9ce354306253c61 /video
parente0a2d152163977fdc2a48ac1bd4144614a1e6f25 (diff)
downloadmpv-344b75f52da349ab293ee2bb7f48604eabcffb0f.tar.bz2
mpv-344b75f52da349ab293ee2bb7f48604eabcffb0f.tar.xz
osx: code cleanups and cosmetic fixes
silence build warnings, clean up code style and remove unused code.
Diffstat (limited to 'video')
-rw-r--r--video/out/cocoa/events_view.m13
-rw-r--r--video/out/cocoa/window.m3
-rw-r--r--video/out/cocoa_common.m2
3 files changed, 5 insertions, 13 deletions
diff --git a/video/out/cocoa/events_view.m b/video/out/cocoa/events_view.m
index a9dec1d1d0..4050e59d04 100644
--- a/video/out/cocoa/events_view.m
+++ b/video/out/cocoa/events_view.m
@@ -23,7 +23,6 @@
#include "events_view.h"
@interface MpvEventsView()
-@property(nonatomic, assign) BOOL clearing;
@property(nonatomic, assign) BOOL hasMouseDown;
@property(nonatomic, retain) NSTrackingArea *tracker;
- (int)mpvButtonNumber:(NSEvent*)event;
@@ -32,7 +31,6 @@
@end
@implementation MpvEventsView
-@synthesize clearing = _clearing;
@synthesize adapter = _adapter;
@synthesize tracker = _tracker;
@synthesize hasMouseDown = _mouse_down;
@@ -110,6 +108,7 @@
{
return [self.adapter mouseEnabled];
}
+
- (BOOL)acceptsFirstResponder
{
return [self.adapter keyboardEnabled] || [self.adapter mouseEnabled];
@@ -145,14 +144,6 @@
}
}
-- (void)setFrameSize:(NSSize)size
-{
- [super setFrameSize:size];
-
- if (self.clearing)
- return;
-}
-
- (NSPoint)convertPointToPixels:(NSPoint)point
{
point = [self convertPoint:point fromView:nil];
@@ -195,6 +186,7 @@
[super mouseDown:event];
}
}
+
- (void)mouseUp:(NSEvent *)event
{
if ([self.adapter mouseEnabled]) {
@@ -203,6 +195,7 @@
[super mouseUp:event];
}
}
+
- (void)rightMouseDown:(NSEvent *)event
{
if ([self.adapter mouseEnabled]) {
diff --git a/video/out/cocoa/window.m b/video/out/cocoa/window.m
index e08f4745bc..6d464a1a69 100644
--- a/video/out/cocoa/window.m
+++ b/video/out/cocoa/window.m
@@ -47,7 +47,7 @@
@synthesize currentScreen = _current_screen;
@synthesize unfScreen = _unf_Screen;
- (id)initWithContentRect:(NSRect)content_rect
- styleMask:(NSUInteger)style_mask
+ styleMask:(NSWindowStyleMask)style_mask
backing:(NSBackingStoreType)buffering_type
defer:(BOOL)flag
screen:(NSScreen *)screen
@@ -255,6 +255,7 @@
- (BOOL)canBecomeMainWindow { return YES; }
- (BOOL)canBecomeKeyWindow { return YES; }
+
- (BOOL)windowShouldClose:(id)sender
{
cocoa_put_key(MP_KEY_CLOSE_WIN);
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index b535de279d..e0f0f785e0 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -129,7 +129,6 @@ static void run_on_main_thread(struct vo *vo, void(^block)(void))
static void queue_new_video_size(struct vo *vo, int w, int h)
{
struct vo_cocoa_state *s = vo->cocoa;
- struct mp_vo_opts *opts = vo->opts;
id<MpvWindowUpdate> win = (id<MpvWindowUpdate>) s->window;
NSRect r = NSMakeRect(0, 0, w, h);
r = [s->current_screen convertRectFromBacking:r];
@@ -955,7 +954,6 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg)
- (void)performAsyncResize:(NSSize)size
{
- struct vo_cocoa_state *s = self.vout->cocoa;
vo_cocoa_resize_redraw(self.vout, size.width, size.height);
}