[2/5] comctl32/monthcal: Don't redraw after MCM_SETCURSEL if selection doesn't change

Nikolay Sivov bunglehead at gmail.com
Thu Sep 24 18:49:32 CDT 2009


>From eb62e9eca092e321dc386fe5a4adb7b138fcd715 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Fri, 25 Sep 2009 03:13:38 +0400
Subject: Don't redraw after MCM_SETCURSEL if selection doesn't change

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

diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index 9d2e0e2..4aa8d71 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -1001,12 +1001,17 @@ MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel)
 
   if(!MONTHCAL_ValidateTime(*curSel)) return FALSE;
 
-  infoPtr->currentMonth=curSel->wMonth;
-  infoPtr->currentYear=curSel->wYear;
-
   MONTHCAL_CopyTime(curSel, &infoPtr->minSel);
   MONTHCAL_CopyTime(curSel, &infoPtr->maxSel);
 
+  /* exit earlier if selection equals current */
+  if (infoPtr->currentMonth == curSel->wMonth &&
+      infoPtr->currentYear  == curSel->wYear  &&
+      infoPtr->curSelDay    == curSel->wDay) return TRUE;
+
+  infoPtr->currentMonth = curSel->wMonth;
+  infoPtr->currentYear  = curSel->wYear;
+
   InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
 
   return TRUE;
-- 
1.5.6.5







More information about the wine-patches mailing list