[aseprite] 113/134: OSX: Fix infinite loop in waiting for lockFocusIfCanDraw=YES

Tobias Hansen thansen at moszumanska.debian.org
Sat Mar 14 17:10:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 6c3b4ba805fdfb8e2e6ee62f1932520e81461fdf
Author: David Capello <davidcapello at gmail.com>
Date:   Mon Jan 26 10:27:36 2015 -0300

    OSX: Fix infinite loop in waiting for lockFocusIfCanDraw=YES
    
    There are some bug report about problems when the window is minimized.
    I was able to reproduce this bug minimizing the window, hiding the dock
    (using the system settings), showing the dock again, and trying to
    restore the window.
---
 src/allegro/src/macosx/qzwindow.m | 46 +++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 21 deletions(-)

diff --git a/src/allegro/src/macosx/qzwindow.m b/src/allegro/src/macosx/qzwindow.m
index e259b00..af59dd8 100644
--- a/src/allegro/src/macosx/qzwindow.m
+++ b/src/allegro/src/macosx/qzwindow.m
@@ -121,28 +121,32 @@ static void prepare_window_for_animation(int refresh_view)
    int pitch, y, x;
 
    _unix_lock_mutex(osx_window_mutex);
-   while (![qd_view lockFocusIfCanDraw]);
-   while (!QDDone([qd_view qdPort]));
-   LockPortBits([qd_view qdPort]);
-   pitch = GetPixRowBytes(GetPortPixMap([qd_view qdPort])) / 4;
-   addr = (unsigned int *)GetPixBaseAddr(GetPortPixMap([qd_view qdPort])) +
-      ((int)([osx_window frame].size.height) - gfx_quartz_window.h) * pitch;
-   if (refresh_view && colorconv_blitter) {
-      src_gfx_rect.width  = gfx_quartz_window.w;
-      src_gfx_rect.height = gfx_quartz_window.h;
-      src_gfx_rect.pitch  = pseudo_screen_pitch;
-      src_gfx_rect.data   = pseudo_screen_addr;
-      dest_gfx_rect.pitch = pitch * 4;
-      dest_gfx_rect.data  = addr;
-      colorconv_blitter(&src_gfx_rect, &dest_gfx_rect);
-   }
-   for (y = gfx_quartz_window.h; y; y--) {
-      for (x = 0; x < gfx_quartz_window.w; x++)
-         *(addr + x) |= 0xff000000;
-      addr += pitch;
+
+   if ([qd_view lockFocusIfCanDraw] == YES) {
+      while (!QDDone([qd_view qdPort]));
+      LockPortBits([qd_view qdPort]);
+
+      pitch = GetPixRowBytes(GetPortPixMap([qd_view qdPort])) / 4;
+      addr = (unsigned int *)GetPixBaseAddr(GetPortPixMap([qd_view qdPort])) +
+         ((int)([osx_window frame].size.height) - gfx_quartz_window.h) * pitch;
+      if (refresh_view && colorconv_blitter) {
+         src_gfx_rect.width  = gfx_quartz_window.w;
+         src_gfx_rect.height = gfx_quartz_window.h;
+         src_gfx_rect.pitch  = pseudo_screen_pitch;
+         src_gfx_rect.data   = pseudo_screen_addr;
+         dest_gfx_rect.pitch = pitch * 4;
+         dest_gfx_rect.data  = addr;
+         colorconv_blitter(&src_gfx_rect, &dest_gfx_rect);
+      }
+      for (y = gfx_quartz_window.h; y; y--) {
+         for (x = 0; x < gfx_quartz_window.w; x++)
+            *(addr + x) |= 0xff000000;
+         addr += pitch;
+      }
+      UnlockPortBits([qd_view qdPort]);
+      [qd_view unlockFocus];
    }
-   UnlockPortBits([qd_view qdPort]);
-   [qd_view unlockFocus];
+
    _unix_unlock_mutex(osx_window_mutex);
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list