Mac OS X gui: Fix the fspanel screen selection, and make sure it is inactive at launch.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 3 Mar 2007 13:35:51 +0000 (13:35 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 3 Mar 2007 13:35:51 +0000 (13:35 +0000)
modules/gui/macosx/fspanel.m

index 7516d81..23e51d6 100644 (file)
     \r
     /* let the window sit on top of everything else and start out completely transparent */\r
     [win setLevel:NSModalPanelWindowLevel];\r
-    [win setAlphaValue:0.0];\r
     i_device = 0;\r
-\r
     [win center];\r
+    [self setNonActive:nil];\r
+\r
     return win;\r
 }\r
 \r
     NSPoint theCoordinate;\r
     NSRect theScreensFrame;\r
     NSRect theWindowsFrame;\r
-\r
-    if( i_device < 0 || i_device >= (signed int)[[NSScreen screens] count] )\r
+    NSScreen *screen;\r
+    \r
+    /* user-defined screen */\r
+    screen = [NSScreen screenWithDisplayID: (CGDirectDisplayID)i_device];\r
+    \r
+    if (!screen)\r
+    {\r
         /* invalid preferences or none specified, using main screen */\r
-        theScreensFrame = [[NSScreen mainScreen] frame];\r
-    else\r
-        /* user-defined screen */\r
-        theScreensFrame = [[[NSScreen screens] objectAtIndex: i_device] frame];\r
+        screen = [NSScreen mainScreen];\r
+    }\r
+\r
+    theScreensFrame = [screen frame];\r
 \r
     theWindowsFrame = [self frame];\r
     \r