Call SyncUpdate in ReleaseDC instead of EndPaint

This commit is contained in:
Vincent Wei
2020-02-27 10:38:05 +08:00
parent 366bbb1ff0
commit 98cdfd9bfb
2 changed files with 5 additions and 15 deletions

View File

@@ -5744,11 +5744,8 @@ HDC GUIAPI BeginPaint (HWND hWnd)
return hdc;
}
/* Since 5.0.0
Call SyncUpdateDC only in EndPaint can eliminate flickers effectively. */
void GUIAPI EndPaint (HWND hWnd, HDC hdc)
{
BOOL synced = FALSE;
PMAINWIN pWin;
MG_CHECK (MG_IS_NORMAL_WINDOW(hWnd));
@@ -5762,8 +5759,6 @@ void GUIAPI EndPaint (HWND hWnd, HDC hdc)
__mg_update_secondary_dc (pWin, hdc, real_dc,
&pWin->pMainWin->update_rc, HT_CLIENT);
ReleaseDC (real_dc);
SyncUpdateDC (real_dc);
synced = TRUE;
}
}
@@ -5793,9 +5788,6 @@ void GUIAPI EndPaint (HWND hWnd, HDC hdc)
ShowCaretEx (hWnd, FALSE);
}
#endif
if (!synced)
SyncUpdateDC (hdc);
}
BOOL RegisterWindowClass (PWNDCLASS pWndClass)

View File

@@ -2289,13 +2289,11 @@ void GUIAPI ReleaseDC (HDC hDC)
pdc = dc_HDC2PDC(hDC);
/* Call SyncUpdateDC at the end of EndPaint to elimiate flickers.
if (pdc->bIsClient) {
LOCK (&__mg_gdilock);
GAL_SyncUpdate (pdc->surface);
UNLOCK (&__mg_gdilock);
}
*/
/* Only call SyncUpdateDC when releasing a DC.
This will emilinate flickers effectively. */
LOCK (&__mg_gdilock);
GAL_SyncUpdate (pdc->surface);
UNLOCK (&__mg_gdilock);
pWin = (PMAINWIN)(pdc->hwnd);
if (pWin && pWin->privCDC == hDC) {