changeset 15327:8e21844c8a4c

enable rootwin
author nplourde
date Mon, 02 May 2005 18:05:59 +0000
parents f351dd913bc6
children 3c008554694e
files libvo/vo_macosx.h libvo/vo_macosx.m
diffstat 2 files changed, 35 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_macosx.h	Mon May 02 17:45:23 2005 +0000
+++ b/libvo/vo_macosx.h	Mon May 02 18:05:59 2005 +0000
@@ -10,6 +10,7 @@
 
 #import <Cocoa/Cocoa.h>
 #import <QuartzCore/QuartzCore.h>
+#import <QuickTime/QuickTime.h>
 
 @interface CustomOpenGLView : NSOpenGLView
 {
@@ -45,6 +46,7 @@
 - (void) fullscreen: (BOOL) animate;
 - (void) ontop;
 - (void) panscan;
+- (void) rootwin;
 
 //event
 - (void) keyDown: (NSEvent *) theEvent;
--- a/libvo/vo_macosx.m	Mon May 02 17:45:23 2005 +0000
+++ b/libvo/vo_macosx.m	Mon May 02 18:05:59 2005 +0000
@@ -50,6 +50,7 @@
 extern int vo_fs;
 static int isFullscreen;
 static int isOntop;
+static int isRootwin;
 extern float monitor_aspect;
 extern int vo_keepaspect;
 extern float movie_aspect;
@@ -141,6 +142,9 @@
 	
 	vo_fs = flags & VOFLAG_FULLSCREEN;
 	
+	if(vo_rootwin)
+		[glView rootwin];	
+
 	if(vo_fs)
 		[glView fullscreen: NO];
 	
@@ -280,6 +284,7 @@
 		case VOCTRL_RESUME: return (int_pause=0);
 		case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data));
 		case VOCTRL_ONTOP: vo_ontop = (!(vo_ontop)); [glView ontop]; return VO_TRUE;
+		case VOCTRL_ROOTWIN: vo_rootwin = (!(vo_rootwin)); [glView rootwin]; return VO_TRUE;
 		case VOCTRL_FULLSCREEN: vo_fs = (!(vo_fs)); [glView fullscreen: YES]; return VO_TRUE;
 		case VOCTRL_GET_PANSCAN: return VO_TRUE;
 		case VOCTRL_SET_PANSCAN: [glView panscan]; return VO_TRUE;
@@ -312,7 +317,7 @@
 	[window setAcceptsMouseMovedEvents:YES];
     [window setTitle:@"MPlayer - The Movie Player"];
 	[window center];
-	[window makeKeyAndOrderFront:nil];
+	[window makeKeyAndOrderFront:self];
 	
 	[self setOpenGLContext:glContext];
 	[glContext setView:self];
@@ -424,7 +429,7 @@
 	glFlush();
 	
 	//auto hide mouse cursor and futur on-screen control?
-	if(isFullscreen && !mouseHide)
+	if(isFullscreen && !mouseHide && !isRootwin)
 	{
 		DateTimeRec d;
 		unsigned long curTime;
@@ -477,10 +482,13 @@
 	//go fullscreen
 	if(vo_fs)
 	{
-		//hide menubar and mouse if fullscreen on main display
-		HideMenuBar();
-		HideCursor();
-		mouseHide = YES;
+		if(!isRootwin)
+		{
+			//hide menubar and mouse if fullscreen on main display
+			HideMenuBar();
+			HideCursor();
+			mouseHide = YES;
+		}
 		
 		panscan_calc();
 		old_frame = [window frame];	//save main window size & position
@@ -535,6 +543,24 @@
 }
 
 /*
+	Toggle rootwin
+ */
+- (void) rootwin
+{
+	if(vo_rootwin)
+	{
+		[window setLevel:CGWindowLevelForKey(kCGDesktopWindowLevelKey)];
+		[window orderBack:self];
+		isRootwin = YES;
+	}
+	else
+	{
+		[window setLevel:NSNormalWindowLevel];
+		isRootwin = NO;
+	}
+}
+
+/*
 	Check event for new event
 */ 
 - (void) check_events
@@ -608,7 +634,7 @@
 */
 - (void) mouseMoved: (NSEvent *) theEvent
 {
-	if(isFullscreen)
+	if(isFullscreen && !isRootwin)
 	{
 		ShowMenuBar();
 		ShowCursor();