summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2006-09-21 22:22:37 +0000
committerFelipe Heidrich <fheidric>2006-09-21 22:22:37 +0000
commit0a51a003b575b3290bf45245fb826eefea2beaa5 (patch)
tree02e9257ba0c5a38242d761881dc8553427a60b5c /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
parenta3a157d38626fc83de615a8399985303171a20b7 (diff)
downloadeclipse.platform.swt-0a51a003b575b3290bf45245fb826eefea2beaa5.tar.gz
eclipse.platform.swt-0a51a003b575b3290bf45245fb826eefea2beaa5.tar.xz
eclipse.platform.swt-0a51a003b575b3290bf45245fb826eefea2beaa5.zip
157865 moving column can lose sort indicator
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
index 7aba98a390..92377b2b4f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
@@ -323,14 +323,16 @@ int /*long*/ gtk_clicked (int /*long*/ widget) {
* There is no API to get a double click on a table column. Normally, when
* the mouse is double clicked, this is indicated by GDK_2BUTTON_PRESS
* but the table column sends the click signal on button release. The fix is to
- * test for doublc click by remembering the last click time and mouse button
+ * test for double click by remembering the last click time and mouse button
* and testing for the double click interval.
*/
boolean doubleClick = false;
+ boolean postEvent = true;
int /*long*/ eventPtr = OS.gtk_get_current_event ();
if (eventPtr != 0) {
GdkEventButton gdkEvent = new GdkEventButton ();
OS.memmove (gdkEvent, eventPtr, GdkEventButton.sizeof);
+ OS.gdk_event_free (eventPtr);
switch (gdkEvent.type) {
case OS.GDK_BUTTON_RELEASE: {
int clickTime = display.getDoubleClickTime ();
@@ -340,11 +342,21 @@ int /*long*/ gtk_clicked (int /*long*/ widget) {
}
lastTime = eventTime == 0 ? 1: eventTime;
lastButton = eventButton;
+ break;
+ }
+ case OS.GDK_MOTION_NOTIFY: {
+ /*
+ * Bug in GTK. Dragging a column in a GtkTreeView causes a clicked
+ * signal to be emitted even though the mouse button was never released.
+ * The fix to ignore the signal if the current GDK event is a motion notify.
+ * The GTK bug was fixed in version 2.6
+ */
+ if (OS.GTK_VERSION < OS.VERSION (2, 6, 0)) postEvent = false;
+ break;
}
}
- OS.gdk_event_free (eventPtr);
}
- postEvent (doubleClick ? SWT.DefaultSelection : SWT.Selection);
+ if (postEvent) postEvent (doubleClick ? SWT.DefaultSelection : SWT.Selection);
return 0;
}