X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=c6a443ed2fd2e25bf9719500d62748be4d5167fc;hb=f6e0ba4110818a2785aa480eaa05836b742e9992;hp=ba81156fe077b68325c942dd9433e08b67f8ce74;hpb=c3c55f17d3d710e42393422550594fe1ce6def6c;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index ba81156..c6a443e 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -5,7 +5,8 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free + * Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -3752,6 +3753,7 @@ void DrawSeekClose() { } + VOID HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) { @@ -4105,7 +4107,12 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) if(saveDiagFlag) { BITMAP b; int i, j=0, m, w, wb, fac=0; char *pData; BITMAPINFOHEADER bih; int color[16], nrColors=0; + HBITMAP src = bufferBitmap, obmp; HDC tmp = CreateCompatibleDC(hdc); + bufferBitmap = CreateCompatibleBitmap(hdc, boardRect.right-boardRect.left, Rect.bottom-Rect.top-2*OUTER_MARGIN); + obmp = SelectObject(tmp, bufferBitmap); + BitBlt(tmp, 0, 0, boardRect.right - boardRect.left, Rect.bottom - Rect.top - 2*OUTER_MARGIN, + tmphdc, boardRect.left, OUTER_MARGIN, SRCCOPY); GetObject(bufferBitmap, sizeof(b), &b); if(pData = malloc(b.bmWidthBytes*b.bmHeight + 10000)) { bih.biSize = sizeof(BITMAPINFOHEADER); @@ -4173,6 +4180,9 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) fputc(pData[i], diagFile); free(pData); } + DeleteObject(bufferBitmap); bufferBitmap = src; + SelectObject(tmp, obmp); + DeleteDC(tmp); } SelectObject(tmphdc, oldBitmap); @@ -8504,6 +8514,7 @@ DisplayFatalError(char *str, int error, int exitStatus) fprintf(debugFP, "%s: %s\n", label, str); } if (appData.popupExitMessage) { + if(appData.icsActive) SendToICS("logout\n"); // [HGM] make sure no new games will be started! (void) MessageBox(hwndMain, str, label, MB_OK| (exitStatus ? MB_ICONSTOP : MB_ICONINFORMATION)); }