[PATCH 2/2] winemac: Remove the live-resize display timer.

Ken Thomases ken at codeweavers.com
Fri Nov 6 02:47:11 CST 2015


It's redundant with the new CVDisplayLink-driven display mechanism.

This reverts commits d55d2ec85 and 94dc91a45.

Signed-off-by: Ken Thomases <ken at codeweavers.com>
---
 dlls/winemac.drv/cocoa_window.h |  1 -
 dlls/winemac.drv/cocoa_window.m | 40 ----------------------------------------
 2 files changed, 41 deletions(-)

diff --git a/dlls/winemac.drv/cocoa_window.h b/dlls/winemac.drv/cocoa_window.h
index f245701..5d581b2 100644
--- a/dlls/winemac.drv/cocoa_window.h
+++ b/dlls/winemac.drv/cocoa_window.h
@@ -56,7 +56,6 @@ @interface WineWindow : NSPanel <NSWindowDelegate>
 
     NSUInteger lastModifierFlags;
 
-    NSTimer* liveResizeDisplayTimer;
     NSRect frameAtResizeStart;
     BOOL resizingFromLeft, resizingFromTop;
 
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index 9e85994..50c5c28 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -292,8 +292,6 @@ @interface WineWindow ()
 @property (assign, nonatomic) void* imeData;
 @property (nonatomic) BOOL commandDone;
 
- at property (retain, nonatomic) NSTimer* liveResizeDisplayTimer;
-
 @property (readonly, copy, nonatomic) NSArray* childWineWindows;
 
     - (void) updateColorSpace;
@@ -653,7 +651,6 @@ @implementation WineWindow
     @synthesize colorKeyed, colorKeyRed, colorKeyGreen, colorKeyBlue;
     @synthesize usePerPixelAlpha;
     @synthesize imeData, commandDone;
-    @synthesize liveResizeDisplayTimer;
 
     + (WineWindow*) createWindowWithFeatures:(const struct macdrv_window_features*)wf
                                  windowFrame:(NSRect)window_frame
@@ -743,8 +740,6 @@ + (WineWindow*) createWindowWithFeatures:(const struct macdrv_window_features*)w
     - (void) dealloc
     {
         [[NSNotificationCenter defaultCenter] removeObserver:self];
-        [liveResizeDisplayTimer invalidate];
-        [liveResizeDisplayTimer release];
         [queue release];
         [latentChildWindows release];
         [latentParentWindow release];
@@ -1555,16 +1550,6 @@ - (void) setShape:(NSBezierPath*)newShape
         [self checkTransparency];
     }
 
-    - (void) setLiveResizeDisplayTimer:(NSTimer*)newTimer
-    {
-        if (newTimer != liveResizeDisplayTimer)
-        {
-            [liveResizeDisplayTimer invalidate];
-            [liveResizeDisplayTimer release];
-            liveResizeDisplayTimer = [newTimer retain];
-        }
-    }
-
     - (void) makeFocused:(BOOL)activate
     {
         if (activate)
@@ -2247,8 +2232,6 @@ - (void) windowDidEndLiveResize:(NSNotification *)notification
             [queue postEvent:event];
             macdrv_release_event(event);
         }
-
-        self.liveResizeDisplayTimer = nil;
     }
 
     - (void) windowDidEnterFullScreen:(NSNotification*)notification
@@ -2464,29 +2447,6 @@ - (void) windowWillStartLiveResize:(NSNotification *)notification
 
         frameAtResizeStart = [self frame];
         resizingFromLeft = resizingFromTop = FALSE;
-
-        // There's a strange restriction in window redrawing during Cocoa-
-        // managed window resizing.  Only calls to -[NSView setNeedsDisplay...]
-        // that happen synchronously when Cocoa tells us that our window size
-        // has changed or asynchronously in a short interval thereafter provoke
-        // the window to redraw.  Calls to those methods that happen asynchronously
-        // a half second or more after the last change of the window size aren't
-        // heeded until the next resize-related user event (e.g. mouse movement).
-        //
-        // Wine often has a significant delay between when it's been told that
-        // the window has changed size and when it can flush completed drawing.
-        // So, our windows would get stuck with incomplete drawing for as long
-        // as the user holds the mouse button down and doesn't move it.
-        //
-        // We address this by "manually" asking our windows to check if they need
-        // redrawing every so often (during live resize only).
-        self.liveResizeDisplayTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/30.0
-                                                                       target:self
-                                                                     selector:@selector(displayIfNeeded)
-                                                                     userInfo:nil
-                                                                      repeats:YES];
-        [[NSRunLoop currentRunLoop] addTimer:liveResizeDisplayTimer
-                                     forMode:NSRunLoopCommonModes];
     }
 
     - (NSRect) windowWillUseStandardFrame:(NSWindow*)window defaultFrame:(NSRect)proposedFrame
-- 
2.6.0




More information about the wine-patches mailing list