From: KRosUser kyle.kcsoftwares@gmail.com
--- dlls/comdlg32/colordlg.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/dlls/comdlg32/colordlg.c b/dlls/comdlg32/colordlg.c index e16014c8d19..3f2a64b6f6c 100644 --- a/dlls/comdlg32/colordlg.c +++ b/dlls/comdlg32/colordlg.c @@ -1095,6 +1095,7 @@ static LRESULT CC_WMLButtonUp( CCPRIV *infoPtr ) { if (infoPtr->capturedGraph) { + ClipCursor(NULL); infoPtr->capturedGraph = 0; ReleaseCapture(); CC_PaintCross(infoPtr); @@ -1172,6 +1173,12 @@ static LRESULT CC_WMLButtonDown( CCPRIV *infoPtr, LPARAM lParam ) } if (i) { + if (infoPtr->capturedGraph) + { + RECT rect; + GetWindowRect(GetDlgItem(infoPtr->hwndSelf, infoPtr->capturedGraph), &rect); + ClipCursor(&rect); + } CC_EditSetRGB(infoPtr); CC_EditSetHSL(infoPtr); CC_PaintCross(infoPtr); @@ -1214,7 +1221,9 @@ static INT_PTR CALLBACK ColorDlgProc( HWND hDlg, UINT message, case WM_INITDIALOG: return CC_WMInitDialog(hDlg, wParam, lParam); case WM_NCDESTROY: - DeleteDC(lpp->hdcMem); + // Ensure clipping is released, in case the dialog is closed before WM_LBUTTONUP is received. + ClipCursor(NULL); + DeleteDC(lpp->hdcMem); DeleteObject(lpp->hbmMem); heap_free(lpp); RemovePropW( hDlg, L"colourdialogprop" ); @@ -1235,11 +1244,11 @@ static INT_PTR CALLBACK ColorDlgProc( HWND hDlg, UINT message, if (CC_WMMouseMove(lpp, lParam)) return TRUE; break; - case WM_LBUTTONUP: /* FIXME: ClipCursor off (if in color graph)*/ + case WM_LBUTTONUP: if (CC_WMLButtonUp(lpp)) return TRUE; break; - case WM_LBUTTONDOWN:/* FIXME: ClipCursor on (if in color graph)*/ + case WM_LBUTTONDOWN: if (CC_WMLButtonDown(lpp, lParam)) return TRUE; break;