Index: gui/primitive.c =================================================================== --- gui/primitive.c (revision 8036) +++ gui/primitive.c (working copy) @@ -999,6 +999,7 @@ AG_Widget *wid = p; int x, y; + SDL_LockSurface(agView->v); for (y = 0; y < r.h; y++) { for (x = 0; x < r.w; x++) { AG_BLEND_RGBA2_CLIPPED(agView->v, @@ -1008,6 +1009,7 @@ func); } } + SDL_UnlockSurface(agView->v); } /* Render a gimp-style background tiling. */ Index: gui/widget.h =================================================================== --- gui/widget.h (revision 8094) +++ gui/widget.h (working copy) @@ -279,8 +279,11 @@ AG_WidgetPutPixel32_GL(p, vx,vy, color); } else #endif - if (!AG_CLIPPED_PIXEL(agView->v, vx,vy)) + if (!AG_CLIPPED_PIXEL(agView->v, vx,vy)) { + SDL_LockSurface(agView->v); AG_PUT_PIXEL2(agView->v, vx,vy, color); + SDL_UnlockSurface(agView->v); + } } static __inline__ void @@ -295,8 +298,11 @@ AG_WidgetPutPixelRGB_GL(p, vx,vy, r,g,b); } else #endif - if (!AG_CLIPPED_PIXEL(agView->v, vx, vy)) + if (!AG_CLIPPED_PIXEL(agView->v, vx, vy)) { + SDL_LockSurface(agView->v); AG_PUT_PIXEL2(agView->v, vx,vy, AG_MapRGB(agVideoFmt,r,g,b)); + SDL_UnlockSurface(agView->v); + } } static __inline__ void