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 <[email protected]> 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 _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

