>From 20c0348d2a158d244db6a4da6ecc5b91f1f53dca Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov@codeweavers.com>
Date: Tue, 20 Sep 2011 11:35:54 +0400
Subject: [PATCH 3/3] Fix today date box painting

---
 dlls/comctl32/monthcal.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index dfa3d6e..762a792 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -987,14 +987,20 @@ static void MONTHCAL_PaintTodayTitle(const MONTHCAL_INFO *infoPtr, HDC hdc, cons
 /* today mark + focus */
 static void MONTHCAL_PaintFocusAndCircle(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps)
 {
-  if((infoPtr->minSel.wMonth == infoPtr->todaysDate.wMonth) &&
-     (infoPtr->minSel.wYear  == infoPtr->todaysDate.wYear) &&
-    !(infoPtr->dwStyle & MCS_NOTODAYCIRCLE))
+  /* circle today date if only it's in fully visible month */
+  if (!(infoPtr->dwStyle & MCS_NOTODAYCIRCLE))
   {
-    MONTHCAL_CircleDay(infoPtr, hdc, &infoPtr->todaysDate);
+    INT i;
+
+    for (i = 0; i < MONTHCAL_GetCalCount(infoPtr); i++)
+      if (!MONTHCAL_CompareMonths(&infoPtr->todaysDate, &infoPtr->calendars[i].month))
+      {
+        MONTHCAL_CircleDay(infoPtr, hdc, &infoPtr->todaysDate);
+        break;
+      }
   }
 
-  if(!MONTHCAL_IsDateEqual(&infoPtr->focusedSel, &st_null))
+  if (!MONTHCAL_IsDateEqual(&infoPtr->focusedSel, &st_null))
   {
     RECT r;
     MONTHCAL_GetDayRect(infoPtr, &infoPtr->focusedSel, &r, -1);
-- 
1.5.6.5


