Dylan Smith : richedit: Send EN_SELCHANGE after wrapping but before EN_CHANGE.

Alexandre Julliard julliard at winehq.org
Wed May 19 10:34:14 CDT 2010


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

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Wed May 19 02:33:02 2010 -0400

richedit: Send EN_SELCHANGE after wrapping but before EN_CHANGE.

The call to ME_SendSelChange cannot be done in ME_CommitUndo like it was
before, because it must be done after wrapping.  Native richedit controls
send EN_CHANGE first, which is sent in ME_UpdateRepaint, so
ME_SendSelChange must be before this notification in ME_UpdateRepaint.

---

 dlls/riched20/paint.c |    3 ++-
 dlls/riched20/undo.c  |    2 --
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index 2b01e3c..fc52afb 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -146,6 +146,8 @@ void ME_UpdateRepaint(ME_TextEditor *editor)
   /* Ensure that the cursor is visible */
   ME_EnsureVisible(editor, &editor->pCursors[0]);
 
+  ME_SendSelChange(editor);
+
   /* send EN_CHANGE if the event mask asks for it */
   if(editor->nEventMask & ENM_CHANGE)
   {
@@ -154,7 +156,6 @@ void ME_UpdateRepaint(ME_TextEditor *editor)
     editor->nEventMask |= ENM_CHANGE;
   }
   ME_Repaint(editor);
-  ME_SendSelChange(editor);
 }
 
 void
diff --git a/dlls/riched20/undo.c b/dlls/riched20/undo.c
index 8db9711..8dab8fe 100644
--- a/dlls/riched20/undo.c
+++ b/dlls/riched20/undo.c
@@ -203,7 +203,6 @@ void ME_CommitUndo(ME_TextEditor *editor) {
   }
 
   ME_AddUndoItem(editor, diUndoEndTransaction, NULL);
-  ME_SendSelChange(editor);
 }
 
 /**
@@ -269,7 +268,6 @@ void ME_CommitCoalescingUndo(ME_TextEditor *editor)
     return;
 
   ME_AddUndoItem(editor, diUndoPotentialEndTransaction, NULL);
-  ME_SendSelChange(editor);
 }
 
 static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem)




More information about the wine-cvs mailing list