[PATCH v2 0/1] MR10730: comctl32: Fix MONTHCAL notification order on date selection.
Ensure MCN_SELECT is sent before MCN_SELCHANGE in MONTHCAL_LButtonUp. Wine-Bug:https://bugs.winehq.org/show_bug.cgi?id=54771 -- v2: comctl32: Fix MONTHCAL notification order on date selection. https://gitlab.winehq.org/wine/wine/-/merge_requests/10730
From: Maotong Zhang <zmtong1988@gmail.com> Ensure MCN_SELECT is sent before MCN_SELCHANGE in MONTHCAL_LButtonUp. Wine-Bug:https://bugs.winehq.org/show_bug.cgi?id=54771 --- dlls/comctl32/monthcal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index c814998d2b6..4eb62cde91b 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -2305,11 +2305,11 @@ MONTHCAL_LButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam) /* will be invalidated here */ MONTHCAL_SetCurSel(infoPtr, &ht.st); + MONTHCAL_NotifySelect(infoPtr); + /* send MCN_SELCHANGE only if new date selected */ - if (!MONTHCAL_IsDateEqual(&sel, &ht.st)) + if (!MONTHCAL_IsDateEqual(&sel, &ht.st) && !(infoPtr->dwStyle & MCS_MULTISELECT)) MONTHCAL_NotifySelectionChange(infoPtr); - - MONTHCAL_NotifySelect(infoPtr); } return 0; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10730
Nikolay Sivov (@nsivov) commented about dlls/comctl32/monthcal.c:
/* will be invalidated here */ MONTHCAL_SetCurSel(infoPtr, &ht.st);
+ MONTHCAL_NotifySelect(infoPtr); + /* send MCN_SELCHANGE only if new date selected */ - if (!MONTHCAL_IsDateEqual(&sel, &ht.st)) + if (!MONTHCAL_IsDateEqual(&sel, &ht.st) && !(infoPtr->dwStyle & MCS_MULTISELECT)) MONTHCAL_NotifySelectionChange(infoPtr); - - MONTHCAL_NotifySelect(infoPtr); }
How did you check this order? I see SELCHANGE -> SELECT order with both v5 and v6. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10730#note_146376
On Wed Jul 22 16:25:38 2026 +0000, Nikolay Sivov wrote: > How did you check this order? I see SELCHANGE -> SELECT order with both > v5 and v6. 1. When selecting a date from the DTP drop-down calendar, DATETIME_Notify handles MCN_SELECT and sends DTN_CLOSEUP. 2. The application then sends DTM_SETSYSTEMTIME, but receives the initial date instead of the selected calendar date. 3. Send MCN_SELECT before MCN_SELCHANGE so that DTM_SETSYSTEMTIME receives the selected calendar date. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10730#note_146465
On Thu Jul 23 13:56:36 2026 +0000, Maotong Zhang wrote:
1. When selecting a date from the DTP drop-down calendar, DATETIME_Notify handles MCN_SELECT and sends DTN_CLOSEUP. 2. The application then sends DTM_SETSYSTEMTIME, but receives the initial date instead of the selected calendar date. 3. Send MCN_SELECT before MCN_SELCHANGE so that DTM_SETSYSTEMTIME receives the selected calendar date. Any chance of adding a test?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10730#note_147797
On Tue Aug 4 07:48:28 2026 +0000, Zhiyi Zhang wrote:
Any chance of adding a test? For bug-54771, the application sends DTM_SETSYSTEMTIME to set the date and time. I will see if I can add a test to verify this behavior.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10730#note_147812
On Tue Aug 4 08:55:38 2026 +0000, Maotong Zhang wrote:
For bug-54771, the application sends DTM_SETSYSTEMTIME to set the date and time. I will see if I can add a test to verify this behavior. What I meant was you are switching notification order, and I don't see that it matches notification order on Windows.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10730#note_148240
participants (4)
-
Maotong Zhang -
Maotong Zhang (@xiaotong) -
Nikolay Sivov (@nsivov) -
Zhiyi Zhang (@zhiyi)