changeset 34297:dc1ac10ececd

Support -title with -vo quartz.
author reimar
date Sat, 03 Dec 2011 22:26:47 +0000
parents d9dfe3689e14
children a15ac2fd7f01
files libvo/vo_quartz.c
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_quartz.c	Sat Dec 03 22:06:50 2011 +0000
+++ b/libvo/vo_quartz.c	Sat Dec 03 22:26:47 2011 +0000
@@ -469,9 +469,6 @@
 
 static void quartz_CreateWindow(uint32_t d_width, uint32_t d_height, WindowAttributes windowAttrs)
 {
-    CFStringRef titleKey;
-    CFStringRef windowTitle;
-
     MenuItemIndex index;
     CFStringRef movMenuTitle;
     CFStringRef aspMenuTitle;
@@ -552,13 +549,6 @@
     CreateWindowGroup(0, &winGroup);
     SetWindowGroup(theWindow, winGroup);
 
-    // Set window title
-    titleKey = CFSTR("MPlayer - The Movie Player");
-    windowTitle = CFCopyLocalizedString(titleKey, NULL);
-    SetWindowTitleWithCFString(theWindow, windowTitle);
-    CFRelease(titleKey);
-    CFRelease(windowTitle);
-
     // Install event handler
     InstallApplicationEventHandler(NewEventHandlerUPP(KeyEventHandler), GetEventTypeCount(key_events), key_events, NULL, NULL);
     InstallApplicationEventHandler(NewEventHandlerUPP(MouseEventHandler), GetEventTypeCount(mouse_events), mouse_events, NULL, NULL);
@@ -608,6 +598,7 @@
 
 static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format)
 {
+    CFStringRef windowTitle;
     WindowAttributes windowAttrs;
     OSErr qterr;
     CGRect tmpBounds;
@@ -669,6 +660,11 @@
         SizeWindow(theWindow, d_width, d_height, 1);
     }
 
+    // Set window title
+    windowTitle = CFStringCreateWithCString(NULL, vo_wintitle ? vo_wintitle : title, kCFStringEncodingUTF8);
+    SetWindowTitleWithCFString(theWindow, windowTitle);
+    CFRelease(windowTitle);
+
     switch (image_format)
     {
     case IMGFMT_RGB32: