summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuong Nguyen <dnguyen>2008-08-25 19:48:42 +0000
committerDuong Nguyen <dnguyen>2008-08-25 19:48:42 +0000
commit941c0732929e0d836913a4e182f1a7bb90c7e46f (patch)
tree51742de8a9700c17e986fce43484a638a7a41135
parente5c54f94dba0a9129c87c68372b565b8971079dd (diff)
downloadeclipse.platform.swt-941c0732929e0d836913a4e182f1a7bb90c7e46f.tar.gz
eclipse.platform.swt-941c0732929e0d836913a4e182f1a7bb90c7e46f.tar.xz
eclipse.platform.swt-941c0732929e0d836913a4e182f1a7bb90c7e46f.zip
Bug 244396 - [DND] Combo on Linux does not fire DragSourceEvent.
- back port for 3.4.1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java6
2 files changed, 9 insertions, 3 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 029149cc62..c194081d8d 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
@@ -1119,7 +1119,9 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) {
if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
GdkEventButton gdkEvent = new GdkEventButton ();
OS.memmove (gdkEvent, event, GdkEventButton.sizeof);
- if (gdkEvent.type == OS.GDK_BUTTON_PRESS) return 0;
+ if (gdkEvent.type == OS.GDK_BUTTON_PRESS && gdkEvent.button == 1 && (style & SWT.READ_ONLY) != 0) {
+ return gtk_button_press_event(widget, event, false);
+ }
}
return super.gtk_button_press_event (widget, event);
}
@@ -1274,7 +1276,7 @@ int /*long*/ gtk_event_after (int /*long*/ widget, int /*long*/ gdkEvent) {
GdkEventButton gdkEventButton = new GdkEventButton ();
OS.memmove (gdkEventButton, gdkEvent, GdkEventButton.sizeof);
if (gdkEventButton.button == 1) {
- if (!sendMouseEvent (SWT.MouseDown, gdkEventButton.button, display.clickCount, 0, false, gdkEventButton.time, gdkEventButton.x_root, gdkEventButton.y_root, false, gdkEventButton.state)) {
+ if ((style & SWT.READ_ONLY) != 0 && !sendMouseEvent (SWT.MouseDown, gdkEventButton.button, display.clickCount, 0, false, gdkEventButton.time, gdkEventButton.x_root, gdkEventButton.y_root, false, gdkEventButton.state)) {
return 1;
}
if (OS.GTK_VERSION >= OS.VERSION (2, 6, 0)) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 55f04f533a..25bf337e7f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -2502,6 +2502,10 @@ public boolean getVisible () {
}
int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) {
+ return gtk_button_press_event (widget, event, true);
+}
+
+int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event, boolean sendMouseDown) {
GdkEventButton gdkEvent = new GdkEventButton ();
OS.memmove (gdkEvent, event, GdkEventButton.sizeof);
if (gdkEvent.type == OS.GDK_3BUTTON_PRESS) return 0;
@@ -2537,7 +2541,7 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) {
if (isDisposed ()) return 1;
}
}
- if (!sendMouseEvent (SWT.MouseDown, gdkEvent.button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state)) {
+ if (sendMouseDown && !sendMouseEvent (SWT.MouseDown, gdkEvent.button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state)) {
result = 1;
}
if (isDisposed ()) return 1;