[vlc-commits] macosx: really fixed the time line drawing artifacts (close #6057)

Felix Paul Kühne git at videolan.org
Thu Feb 23 16:37:18 CET 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Feb 23 16:35:52 2012 +0100| [a0ebcbbdc36eb15c74c9ed140ff0474881fc43d3] | committer: Felix Paul Kühne

macosx: really fixed the time line drawing artifacts (close #6057)
(cherry picked from commit 55a47406fd1391b61b85b2051951434741e299a9)

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

 .../macosx/Resources/English.lproj/MainMenu.xib    |    4 +---
 modules/gui/macosx/MainWindow.m                    |    9 +++++++--
 modules/gui/macosx/misc.m                          |    5 +++--
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.xib b/extras/package/macosx/Resources/English.lproj/MainMenu.xib
index 94dec39..ee9d2b9 100644
--- a/extras/package/macosx/Resources/English.lproj/MainMenu.xib
+++ b/extras/package/macosx/Resources/English.lproj/MainMenu.xib
@@ -26,7 +26,7 @@
       <integer value="4722"/>
       <integer value="4850"/>
       <integer value="2770"/>
-      <integer value="21"/>
+      <integer value="4756"/>
       <integer value="29"/>
       <integer value="2730"/>
       <integer value="283"/>
@@ -672,7 +672,6 @@
                   <string key="NSFrame">{{218, 11}, {60, 12}}</string>
                   <reference key="NSSuperview" ref="129808516"/>
                   <int key="NSViewLayerContentsRedrawPolicy">2</int>
-                  <bool key="NSViewCanDrawConcurrently">YES</bool>
                   <string key="NSClassName">VLCThreePartImageView</string>
                 </object>
                 <object class="NSButton" id="707945673">
@@ -1141,7 +1140,6 @@
               <string key="NSFrame">{{-1, 0}, {605, 36}}</string>
               <reference key="NSSuperview" ref="429932428"/>
               <int key="NSViewLayerContentsRedrawPolicy">2</int>
-              <bool key="NSViewCanDrawConcurrently">YES</bool>
               <string key="NSClassName">VLCThreePartDropView</string>
             </object>
           </object>
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index a1163a9..a13ebae 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -463,6 +463,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
         [o_sidebar_scrollview setBorderType: NSNoBorder];
     }
 
+    NSRect frame;
+    frame = [o_time_sld_fancygradient_view frame];
+    frame.size.width = 0;
+    [o_time_sld_fancygradient_view setFrame: frame];
+
     if (OSX_LION)
         [o_resize_view setImage: NULL];
 
@@ -1240,9 +1245,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
         NSRect oldFrame = [o_time_sld_fancygradient_view frame];
         if (f_value != oldFrame.size.width)
         {
-            [o_time_sld_fancygradient_view setHidden: NO];
+            if ([o_time_sld_fancygradient_view isHidden])
+                [o_time_sld_fancygradient_view setHidden: NO];
             [o_time_sld_fancygradient_view setFrame: NSMakeRect( oldFrame.origin.x, oldFrame.origin.y, f_value, oldFrame.size.height )];
-            [o_time_sld_fancygradient_view setNeedsDisplay:YES];
         }
     }
     else
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index c9a8533..bf9004f 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -672,6 +672,9 @@ void _drawFrameInRect(NSRect frameRect)
 
 - (void)drawRect:(NSRect)rect
 {
+    [(VLCMainWindow *)[self window] drawFancyGradientEffectForTimeSlider];
+    msleep( 10000 ); //wait for the gradient to draw completely
+
     /* Draw default to make sure the slider behaves correctly */
     [[NSGraphicsContext currentContext] saveGraphicsState];
     NSRectClip(NSZeroRect);
@@ -681,8 +684,6 @@ void _drawFrameInRect(NSRect frameRect)
     NSRect knobRect = [[self cell] knobRectFlipped:NO];
     knobRect.origin.y+=1;
     [self drawKnobInRect: knobRect];
-
-    [(VLCMainWindow *)[self window] drawFancyGradientEffectForTimeSlider];
 }
 
 @end



More information about the vlc-commits mailing list