changeset 3222:3a2355dcef13

6770017: PIT : java/awt/Choice/BlockedWin32Choice/BlockedWin32Choice.java fails on 6u12 b01 pit build Reviewed-by: art
author dcherepanov
date Fri, 26 Nov 2010 15:07:53 +0300
parents b6d79a32b07a
children 31196f8ec2d9
files src/windows/native/sun/windows/awt_Choice.cpp src/windows/native/sun/windows/awt_Choice.h
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/windows/awt_Choice.cpp	Fri Nov 26 14:36:42 2010 +0300
+++ b/src/windows/native/sun/windows/awt_Choice.cpp	Fri Nov 26 15:07:53 2010 +0300
@@ -86,6 +86,7 @@
 AwtChoice::AwtChoice() {
     m_hList = NULL;
     m_listDefWindowProc = NULL;
+    m_selectedItem = -1;
 }
 
 LPCTSTR AwtChoice::GetClassName() {
@@ -437,9 +438,10 @@
 MsgRouting AwtChoice::WmNotify(UINT notifyCode)
 {
     if (notifyCode == CBN_SELCHANGE) {
-        int itemSelect = (int)SendMessage(CB_GETCURSEL);
-        if (itemSelect != CB_ERR){
-            DoCallback("handleAction", "(I)V", itemSelect);
+        int selectedItem = (int)SendMessage(CB_GETCURSEL);
+        if (selectedItem != CB_ERR && m_selectedItem != selectedItem){
+            m_selectedItem = selectedItem;
+            DoCallback("handleAction", "(I)V", selectedItem);
         }
     } else if (notifyCode == CBN_DROPDOWN) {
 
--- a/src/windows/native/sun/windows/awt_Choice.h	Fri Nov 26 14:36:42 2010 +0300
+++ b/src/windows/native/sun/windows/awt_Choice.h	Fri Nov 26 15:07:53 2010 +0300
@@ -94,6 +94,7 @@
     static BOOL sm_isMouseMoveInList;
     HWND m_hList;
     WNDPROC m_listDefWindowProc;
+    int m_selectedItem;
     static LRESULT CALLBACK ListWindowProc(HWND hwnd, UINT message,
                                            WPARAM wParam, LPARAM lParam);
 };