Nikolay Sivov : comctl32/monthcal: Don' t redraw after MCM_SETCURSEL if selection doesn't change.

Alexandre Julliard julliard at winehq.org
Fri Sep 25 10:24:44 CDT 2009


Module: wine
Branch: master
Commit: 548645d36074d962bf71acd7e15fd234e79070c1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=548645d36074d962bf71acd7e15fd234e79070c1

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Fri Sep 25 03:13:38 2009 +0400

comctl32/monthcal: 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;




More information about the wine-cvs mailing list