changeset 24958:d86224fac2b5

Handle mouse up event to get double click support from mp_fifo.
author ulion
date Wed, 07 Nov 2007 01:44:41 +0000
parents 24af717a54b3
children f13b32b2bee4
files libvo/vo_quartz.c
diffstat 1 files changed, 23 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_quartz.c	Tue Nov 06 23:44:53 2007 +0000
+++ b/libvo/vo_quartz.c	Wed Nov 07 01:44:41 2007 +0000
@@ -308,6 +308,7 @@
 			break;
 			
 			case kEventMouseDown:
+			case kEventMouseUp:
 			{
 				EventMouseButton button;
 				short part;
@@ -317,7 +318,26 @@
 				GetEventParameter(event, kEventParamMouseButton, typeMouseButton, 0, sizeof(EventMouseButton), 0, &button);
 				
 				part = FindWindow(mousePos,&tmpWin);
+				if(kind == kEventMouseUp)
+				{
+					if (part != inContent)
+						break;
+					switch(button)
+					{ 
+						case kEventMouseButtonPrimary:
+							mplayer_put_key(MOUSE_BTN0);
+							break;
+						case kEventMouseButtonSecondary:
+							mplayer_put_key(MOUSE_BTN1);
+							break;
+						case kEventMouseButtonTertiary:
+							mplayer_put_key(MOUSE_BTN2);
+							break;
 				
+						default:result = eventNotHandledErr;break;
+					}
+					break;
+				}
 				if( (winMousePos.h > (bounds.right - 15)) && (winMousePos.v > (bounds.bottom)) )
 				{
 					if(!vo_quartz_fs)
@@ -335,13 +355,13 @@
 					switch(button)
 					{ 
 						case kEventMouseButtonPrimary:
-							mplayer_put_key(MOUSE_BTN0);
+							mplayer_put_key(MOUSE_BTN0 | MP_KEY_DOWN);
 							break;
 						case kEventMouseButtonSecondary:
-							mplayer_put_key(MOUSE_BTN1);
+							mplayer_put_key(MOUSE_BTN1 | MP_KEY_DOWN);
 							break;
 						case kEventMouseButtonTertiary:
-							mplayer_put_key(MOUSE_BTN2);
+							mplayer_put_key(MOUSE_BTN2 | MP_KEY_DOWN);
 							break;
 				
 						default:result = eventNotHandledErr;break;
@@ -350,9 +370,6 @@
 			}		
 			break;
 			
-			case kEventMouseUp:
-			break;
-			
 			case kEventMouseDragged:
 			break;