summaryrefslogtreecommitdiffstats
path: root/libvo/vo_corevideo.m
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-12-18 18:54:42 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-12-18 18:54:42 +0200
commitefcc9ad7120e01a17fc3659cb0229135b1cebb95 (patch)
treeeb15edb75377eedd5d7397209e8c0d594020663e /libvo/vo_corevideo.m
parent1598302be65c77c107330dc46fd0dabface3112d (diff)
parent8fcbe5835d038649e70da410d46c4f5cd502c261 (diff)
downloadmpv-efcc9ad7120e01a17fc3659cb0229135b1cebb95.tar.bz2
mpv-efcc9ad7120e01a17fc3659cb0229135b1cebb95.tar.xz
Merge svn changes up to r30055
Diffstat (limited to 'libvo/vo_corevideo.m')
-rw-r--r--libvo/vo_corevideo.m23
1 files changed, 15 insertions, 8 deletions
diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m
index 1748e059ec..9cd3447072 100644
--- a/libvo/vo_corevideo.m
+++ b/libvo/vo_corevideo.m
@@ -115,6 +115,9 @@ static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigne
static void update_screen_info(void)
{
+ if (screen_id == -1 && xinerama_screen > -1)
+ screen_id = xinerama_screen;
+
screen_array = [NSScreen screens];
if(screen_id < (int)[screen_array count])
{
@@ -494,16 +497,21 @@ static int control(uint32_t request, void *data)
- (void) config
{
- uint32_t d_width;
- uint32_t d_height;
-
- NSRect frame;
+ NSRect visibleFrame;
CVReturn error = kCVReturnSuccess;
//config window
- d_width = vo_dwidth; d_height = vo_dheight;
- frame = NSMakeRect(0, 0, d_width, d_height);
- [window setContentSize: frame.size];
+ [window setContentSize:NSMakeSize(vo_dwidth, vo_dheight)];
+
+ // Use visibleFrame to position the window taking the menu bar and dock into account.
+ // Also flip vo_dy since the screen origin is in the bottom left on OSX.
+ if (screen_id < 0)
+ visibleFrame = [[[mpGLView window] screen] visibleFrame];
+ else
+ visibleFrame = [[[NSScreen screens] objectAtIndex:screen_id] visibleFrame];
+ [window setFrameTopLeftPoint:NSMakePoint(
+ visibleFrame.origin.x + vo_dx,
+ visibleFrame.origin.y + visibleFrame.size.height - vo_dy)];
[self releaseVideoSpecific];
error = CVPixelBufferCreateWithBytes(NULL, image_width, image_height, pixelFormat, image_datas[0], image_width*image_bytes, NULL, NULL, NULL, &frameBuffers[0]);
@@ -520,7 +528,6 @@ static int control(uint32_t request, void *data)
mp_msg(MSGT_VO, MSGL_ERR,"[vo_corevideo] Failed to create OpenGL texture(%d)\n", error);
//show window
- [window center];
[window makeKeyAndOrderFront:mpGLView];
if(vo_rootwin)