diff libvo/vo_directx.c @ 11542:85e503ddf65f

runtime 'stay-on-top' functionality
author joey
date Sun, 30 Nov 2003 16:36:10 +0000
parents 3638adcfdcbd
children a8adfcf47f4e
line wrap: on
line diff
--- a/libvo/vo_directx.c	Sun Nov 30 14:45:42 2003 +0000
+++ b/libvo/vo_directx.c	Sun Nov 30 16:36:10 2003 +0000
@@ -43,7 +43,6 @@
 static RECT                 rd;                     //rect of our stretched image
 static RECT                 rs;                     //rect of our source image
 static HWND                 hWnd=NULL;              //handle to the window
-static uint32_t             ontop=0;                //always in foreground
 static uint32_t image_width, image_height;          //image width and height
 static uint32_t d_image_width, d_image_height;      //image width and height zoomed 
 static uint8_t  *image=NULL;                        //image data
@@ -60,6 +59,7 @@
 extern int vo_doublebuffering;                      //tribblebuffering    
 extern int vo_fs;
 extern int vo_directrendering;
+extern int vo_ontop;
 
 /*****************************************************************************
  * DirectDraw GUIDs.
@@ -527,12 +527,12 @@
         dwUpdateFlags = DDOVER_SHOW | DDOVER_DDFX;
         /*if hardware can't do colorkeying set the window on top*/
 		if(capsDrv.dwCKeyCaps & DDCKEYCAPS_DESTOVERLAY) dwUpdateFlags |= DDOVER_KEYDESTOVERRIDE;
-        else ontop = 1;
+        else vo_ontop = 1;
 	}
 	/*calculate window rect with borders*/
 	if(!vo_fs)AdjustWindowRect(&rd_window,WS_OVERLAPPEDWINDOW|WS_SIZEBOX,0);
 
-	if((vo_fs) || (!vo_fs && ontop))hWndafter=HWND_TOPMOST;
+	if((vo_fs) || (!vo_fs && vo_ontop))hWndafter=HWND_TOPMOST;
 	else hWndafter=HWND_NOTOPMOST;
 
 	/*display the window*/
@@ -822,11 +822,6 @@
 			mp_msg(MSGT_VO,MSGL_V,"<vo_directx><INFO>disabled overlay\n");
 		    nooverlay = 1;
 		}
-		if(strstr(arg,"ontop"))
-		{
-			mp_msg(MSGT_VO,MSGL_V,"<vo_directx><INFO>window ontop\n");
-			ontop = 1;
-		}
 	}
 	if (Directx_InitDirectDraw()!= 0)return 1;          //init DirectDraw
     if (Directx_CheckPrimaryPixelformat()!=0)return 1;
@@ -1162,6 +1157,18 @@
         return query_format(*((uint32_t*)data));
 	case VOCTRL_DRAW_IMAGE:
         return put_image(data);
+    case VOCTRL_ONTOP:
+	        if(vm)
+			{
+				mp_msg(MSGT_VO, MSGL_ERR,"<vo_directx><ERROR>ontop has no meaning in exclusive mode\n");
+			}
+	        else
+			{
+				if(vo_ontop) vo_ontop = 0;
+				else vo_ontop = 1;
+				Directx_ManageDisplay(0,0);
+			}
+		return VO_TRUE;
     case VOCTRL_FULLSCREEN:
 		{
 	        if(vm)