diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-05-10 09:51:45 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-05-10 09:52:23 -0400 |
commit | afaa39bdb2aab9490e8e3fdeb1deb754caa3e91b (patch) | |
tree | eb8d1da8d45a447308a40ca4bfbe71a98b421c9a /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java | |
parent | 2c17c2eb0fd706a78278bd4e42a02b892eef6dde (diff) | |
download | eclipse.platform.swt-afaa39bdb2aab9490e8e3fdeb1deb754caa3e91b.tar.gz eclipse.platform.swt-afaa39bdb2aab9490e8e3fdeb1deb754caa3e91b.tar.xz eclipse.platform.swt-afaa39bdb2aab9490e8e3fdeb1deb754caa3e91b.zip |
Bug 378081 - Combo should not send ModifyEvent on #select(int) if item unchanged
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java index c4b4978bd1..e9ee34b2df 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java @@ -1632,10 +1632,11 @@ public void removeVerifyListener (VerifyListener listener) { public void select (int index) { checkWidget(); if (index < 0 || index >= items.length) return; + int selected = OS.gtk_combo_box_get_active (handle); OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); OS.gtk_combo_box_set_active (handle, index); OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); - if ((style & SWT.READ_ONLY) != 0) { + if ((style & SWT.READ_ONLY) != 0 && selected != index) { /* * Feature in GTK. Read Only combo boxes do not get a chance to send out a * Modify event in the gtk_changed callback. The fix is to send a Modify event @@ -1867,15 +1868,7 @@ public void setText (String string) { if ((style & SWT.READ_ONLY) != 0) { int index = indexOf (string); if (index == -1) return; - OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); - OS.gtk_combo_box_set_active (handle, index); - OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); - /* - * Feature in GTK. Read Only combo boxes do not get a chance to send out a - * Modify event in the gtk_changed callback. The fix is to send a Modify event - * here. - */ - sendEvent (SWT.Modify); + select (index); return; } /* |