[Bug 10043] Babas Chess version 3.6

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Oct 18 10:55:50 CDT 2007


http://bugs.winehq.org/show_bug.cgi?id=10043





--- Comment #8 from Alex Villacís Lasso <a_villacis at palosanto.com>  2007-10-18 10:55:49 ---
Created an attachment (id=8643)
 --> (http://bugs.winehq.org/attachment.cgi?id=8643)
Patch to fix behavior of VK_RETURN in single-line richedit control

As I thought, this is a case of a bugfix uncovering another bug. 

The problematic controls are single-line richedit controls at the bottom of the
application window. The user is supposed to type text and hit RETURN (WM_CHAR =
VK_RETURN) in order to send a message. The application sends a WM_GETTEXT
message in order to retrieve the text the user just entered, and process it.

The behavior of the single-line richedit control in builtin was never right to
begin with. For the sake of example, let's say the user types "qqq", then
presses ENTER. On a single-line richedit control, native riched20 returns "qqq"
without any \r or \n tacked on. This indicates that the control refuses to
insert carriage returns into the text of a single-line richedit control. On the
same scenario, the old code in builtin riched20 returned "qqq\r", which is
already wrong (the hidden bug). However, this was not enough (yet) to break
BabasChess. 

The new code in builtin returns "qqq\r\n", because (as demonstrated by tests),
any carriage returns must be converted to \r\n pairs when retrieved via
WM_GETTEXT. However, since this is a single-line richedit control, there was
not supposed to be any carriage returns in the first place. With the extra \n
added, BabasChess broke, as experienced by the submitter of the bug.

The attached patch fixes this by enforcing the rule that WM_CHAR may not insert
carriage returns (VK_RETURN) into the text of a single-line richedit control,
and by adding a test to check for this behavior. This patch will shortly be
sent to wine-patches.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the wine-bugs mailing list