# HG changeset patch # User nplourde # Date 1115057159 0 # Node ID 8e21844c8a4cbeef13bf69cd4e23e354dba9c9c1 # Parent f351dd913bc6c5b461e2eb809adec518d14d987c enable rootwin diff -r f351dd913bc6 -r 8e21844c8a4c libvo/vo_macosx.h --- 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 #import +#import @interface CustomOpenGLView : NSOpenGLView { @@ -45,6 +46,7 @@ - (void) fullscreen: (BOOL) animate; - (void) ontop; - (void) panscan; +- (void) rootwin; //event - (void) keyDown: (NSEvent *) theEvent; diff -r f351dd913bc6 -r 8e21844c8a4c libvo/vo_macosx.m --- 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();