[Bug 19756] TaskCoach: Cannot add new task with a due date

WineHQ Bugzilla wine-bugs at winehq.org
Fri Apr 23 08:29:19 CDT 2021


https://bugs.winehq.org/show_bug.cgi?id=19756

Damjan Jovanovic <damjan.jov at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch

--- Comment #6 from Damjan Jovanovic <damjan.jov at gmail.com> ---
So reading that file in wxWidgets 2.8.6's source code, and comparing it to
Wine's dlls/comctl32/datetime.c, I saw where the problem was. (This is why open
source is great, and dogfood bugs are the best.)

wxWidgets' wxDatePickerCtrl control updates its internal m_date variable when
it gets a DTN_DATETIMECHANGE notification from the comctl32 date time control.
But Wine's comctl32 only sends that notification when you open the drop-down
menu and click on a date, not when you just tick the checkbox without clicking
on a date (even though a date (today's date) is immediately shown when you
click the checkbox). Then, when it reaches that wxDatePickerCtrl::GetValue()
method, it checks whether its internal m_date is the same as the one in
(Wine's) date time control, and since it isn't (since no DTN_DATETIMECHANGE was
sent when you only ticked the checkbox), it fails the assertion and opens the
debug alert messagebox.

The fix is 1 line of code: all we need to do is send a DTN_DATETIMECHANGE
notification when the checkbox is clicked:

---snip---
diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
index f44b52c3b65..93bca8c2f5c 100644
--- a/dlls/comctl32/datetime.c
+++ b/dlls/comctl32/datetime.c
@@ -1060,6 +1060,7 @@ DATETIME_Button_Command (DATETIME_INFO *infoPtr, WPARAM
wParam, LPARAM lParam)
         DWORD state = SendMessageW((HWND)lParam, BM_GETCHECK, 0, 0);
         infoPtr->dateValid = (state == BST_CHECKED);
         InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
+        DATETIME_SendDateTimeChangeNotify(infoPtr);
     }
     return 0;
 }
---snip---

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list