Ken Thomases : winemac: Keep old window surface for minimized windows to allow redrawing.

Alexandre Julliard julliard at winehq.org
Tue Jun 4 15:48:35 CDT 2013


Module: wine
Branch: master
Commit: f57db8a3deafd5613232736c00fefd6e541b6a1d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f57db8a3deafd5613232736c00fefd6e541b6a1d

Author: Ken Thomases <ken at codeweavers.com>
Date:   Tue Jun  4 04:59:45 2013 -0500

winemac: Keep old window surface for minimized windows to allow redrawing.

This improves the animation of the window unminimizing from the Dock in some
cases.  The window would often be blank or, for shaped windows, invisible
during that animation.

---

 dlls/winemac.drv/macdrv.h |    1 +
 dlls/winemac.drv/window.c |   25 ++++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h
index 8e0b0f8..085f786 100644
--- a/dlls/winemac.drv/macdrv.h
+++ b/dlls/winemac.drv/macdrv.h
@@ -135,6 +135,7 @@ struct macdrv_win_data
     BOOL                per_pixel_alpha : 1;    /* is window using per-pixel alpha? */
     BOOL                minimized : 1;          /* is window minimized? */
     struct window_surface *surface;
+    struct window_surface *unminimized_surface;
 };
 
 extern struct macdrv_win_data *get_win_data(HWND hwnd) DECLSPEC_HIDDEN;
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c
index 3353749..77d2ea0 100644
--- a/dlls/winemac.drv/window.c
+++ b/dlls/winemac.drv/window.c
@@ -535,6 +535,8 @@ static void destroy_cocoa_window(struct macdrv_win_data *data)
     data->color_key = CLR_INVALID;
     if (data->surface) window_surface_release(data->surface);
     data->surface = NULL;
+    if (data->unminimized_surface) window_surface_release(data->unminimized_surface);
+    data->unminimized_surface = NULL;
 }
 
 
@@ -1108,6 +1110,11 @@ BOOL CDECL macdrv_UpdateLayeredWindow(HWND hwnd, const UPDATELAYEREDWINDOWINFO *
         set_window_surface(data->cocoa_window, data->surface);
         if (surface) window_surface_release(surface);
         surface = data->surface;
+        if (data->unminimized_surface)
+        {
+            window_surface_release(data->unminimized_surface);
+            data->unminimized_surface = NULL;
+        }
     }
     else set_surface_use_alpha(surface, TRUE);
 
@@ -1333,7 +1340,23 @@ void CDECL macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags,
     if (!data->ulw_layered)
     {
         if (surface) window_surface_add_ref(surface);
-        set_window_surface(data->cocoa_window, surface);
+        if (new_style & WS_MINIMIZE)
+        {
+            if (!data->unminimized_surface && data->surface)
+            {
+                data->unminimized_surface = data->surface;
+                window_surface_add_ref(data->unminimized_surface);
+            }
+        }
+        else
+        {
+            set_window_surface(data->cocoa_window, surface);
+            if (data->unminimized_surface)
+            {
+                window_surface_release(data->unminimized_surface);
+                data->unminimized_surface = NULL;
+            }
+        }
         if (data->surface) window_surface_release(data->surface);
         data->surface = surface;
     }




More information about the wine-cvs mailing list