# HG changeset patch # User ulion # Date 1198152044 0 # Node ID 8dfc8a3b4152714a46f6242f29c4ca14dddb66e7 # Parent 959fca775f43b67a3e9071f5bcc37fd12b03cd83 Support send mouse movements commands to mplayer. diff -r 959fca775f43 -r 8dfc8a3b4152 libvo/vo_macosx.m --- a/libvo/vo_macosx.m Thu Dec 20 11:36:53 2007 +0000 +++ b/libvo/vo_macosx.m Thu Dec 20 12:00:44 2007 +0000 @@ -63,6 +63,7 @@ extern float monitor_aspect; extern float movie_aspect; static float old_movie_aspect; +extern int enable_mouse_movements; static float winAlpha = 1; static int int_pause = 0; @@ -671,8 +672,6 @@ int padding = 0; NSRect frame = [self frame]; - vo_dwidth = frame.size.width; - vo_dheight = frame.size.height; glViewport(0, 0, frame.size.width, frame.size.height); glMatrixMode(GL_PROJECTION); @@ -705,6 +704,8 @@ { textureFrame = frame; } + vo_dwidth = textureFrame.size.width; + vo_dheight = textureFrame.size.height; } /* @@ -1004,6 +1005,16 @@ CGDisplayShowCursor(kCGDirectMainDisplay); mouseHide = NO; } + if (enable_mouse_movements) { + NSPoint p =[self convertPoint:[theEvent locationInWindow] fromView:nil]; + if ([self mouse:p inRect:textureFrame]) { + char cmdstr[40]; + snprintf(cmdstr, sizeof(cmdstr), "set_mouse_pos %i %i", + (int)(vo_fs ? p.x : (p.x - textureFrame.origin.x)), + (int)(vo_fs ? [self frame].size.height - p.y: (NSMaxY(textureFrame) - p.y))); + mp_input_queue_cmd(mp_input_parse_cmd(cmdstr)); + } + } } - (void) mouseDown: (NSEvent *) theEvent