[vlc-commits] macosx: don't center the fspanel on normal restores (close #5641)

Felix Paul Kühne git at videolan.org
Mon Apr 22 00:06:58 CEST 2013


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Apr 22 00:06:16 2013 +0200| [939fb0dcf4424f2d71383881a1d2a3897ea8a707] | committer: Felix Paul Kühne

macosx: don't center the fspanel on normal restores (close #5641)

It is still being centered on VLCFirstRun and when switching screens

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=939fb0dcf4424f2d71383881a1d2a3897ea8a707
---

 extras/package/macosx/Resources/English.lproj/MainMenu.xib |   10 +++-------
 modules/gui/macosx/MainWindow.m                            |    2 ++
 modules/gui/macosx/fspanel.m                               |    9 +++------
 3 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.xib b/extras/package/macosx/Resources/English.lproj/MainMenu.xib
index 3600b26..b092e1e 100644
--- a/extras/package/macosx/Resources/English.lproj/MainMenu.xib
+++ b/extras/package/macosx/Resources/English.lproj/MainMenu.xib
@@ -21,8 +21,8 @@
     </object>
     <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
       <bool key="EncodedWithXMLCoder">YES</bool>
-      <integer value="5260"/>
       <integer value="21"/>
+      <integer value="5260"/>
       <integer value="2730"/>
       <integer value="5457"/>
       <integer value="4850"/>
@@ -4081,6 +4081,7 @@
         </object>
         <string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
         <string key="NSMaxSize">{1.7976931348623157e+308, 1.7976931348623157e+308}</string>
+        <string key="NSFrameAutosaveName">fspanel</string>
         <bool key="NSWindowIsRestorable">YES</bool>
       </object>
       <object class="NSWindowTemplate" id="747974943">
@@ -5146,7 +5147,7 @@ LCAuLi4</string>
         <bool key="NSWindowIsRestorable">YES</bool>
       </object>
       <object class="NSCustomView" id="455649453">
-        <reference key="NSNextResponder"/>
+        <nil key="NSNextResponder"/>
         <int key="NSvFlags">268</int>
         <object class="NSMutableArray" key="NSSubviews">
           <bool key="EncodedWithXMLCoder">YES</bool>
@@ -5155,7 +5156,6 @@ LCAuLi4</string>
             <int key="NSvFlags">268</int>
             <string key="NSFrame">{{19, 22}, {273, 18}}</string>
             <reference key="NSSuperview" ref="455649453"/>
-            <reference key="NSWindow"/>
             <bool key="NSEnabled">YES</bool>
             <object class="NSTextFieldCell" key="NSCell" id="827054880">
               <int key="NSCellFlags">605028416</int>
@@ -5173,7 +5173,6 @@ LCAuLi4</string>
             <int key="NSvFlags">-2147483380</int>
             <string key="NSFrame">{{19, 22}, {273, 18}}</string>
             <reference key="NSSuperview" ref="455649453"/>
-            <reference key="NSWindow"/>
             <bool key="NSEnabled">YES</bool>
             <object class="NSTextFieldCell" key="NSCell" id="887800287">
               <int key="NSCellFlags">605028416</int>
@@ -5191,7 +5190,6 @@ LCAuLi4</string>
             <int key="NSvFlags">298</int>
             <string key="NSFrame">{{28, 3}, {261, 16}}</string>
             <reference key="NSSuperview" ref="455649453"/>
-            <reference key="NSWindow"/>
             <bool key="NSEnabled">YES</bool>
             <object class="NSSliderCell" key="NSCell" id="1014018484">
               <int key="NSCellFlags">-1543241472</int>
@@ -5211,8 +5209,6 @@ LCAuLi4</string>
           </object>
         </object>
         <string key="NSFrameSize">{309, 41}</string>
-        <reference key="NSSuperview"/>
-        <reference key="NSWindow"/>
         <string key="NSClassName">NSView</string>
       </object>
     </object>
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index ec59ac4..c9ade4b 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -323,6 +323,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
         NSUInteger i_sidebaritem_count = [o_sidebaritems count];
         for (NSUInteger x = 0; x < i_sidebaritem_count; x++)
             [o_sidebar_view expandItem: [o_sidebaritems objectAtIndex: x] expandChildren: YES];
+
+        [o_fspanel center];
     }
 
     if (b_dark_interface) {
diff --git a/modules/gui/macosx/fspanel.m b/modules/gui/macosx/fspanel.m
index 3851065..4cf873a 100644
--- a/modules/gui/macosx/fspanel.m
+++ b/modules/gui/macosx/fspanel.m
@@ -56,7 +56,7 @@
 
     /* let the window sit on top of everything else and start out completely transparent */
     [win setLevel:NSModalPanelWindowLevel];
-    i_device = 0;
+    i_device = config_GetInt(VLCIntf, "macosx-vdev");
     hideAgainTimer = fadeTimer = nil;
     [self setNonActive:nil];
     return win;
@@ -72,8 +72,6 @@
     if (!isInside)
         [self mouseExited:NULL];
 
-    [self center];
-
     /* get a notification if VLC isn't the active app anymore */
     [[NSNotificationCenter defaultCenter]
     addObserver: self
@@ -359,10 +357,9 @@
         [o_vout_window release];
     o_vout_window = [o_window retain];
     int i_newdevice = (int)[[o_vout_window screen] displayID];
-    if (i_newdevice != i_device) {
-        i_device = i_newdevice;
+    if (i_newdevice != i_device && i_device != 0)
         [self center];
-    }
+    i_device = i_newdevice;
 }
 @end
 



More information about the vlc-commits mailing list