mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-02-07 11:01:57 +08:00
Call SyncUpdate in ReleaseDC instead of EndPaint
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user