diff options
author | Felipe Heidrich <fheidric> | 2003-06-19 19:43:06 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2003-06-19 19:43:06 +0000 |
commit | b8f279dbff859535eb322f2c5bb26cb2e95754de (patch) | |
tree | c703ac8be3875422f3510d290c8df39d399c481f | |
parent | fb6f478dbfcbab845aa9bf8bdfe656035b851fd4 (diff) | |
download | eclipse.platform.swt-b8f279dbff859535eb322f2c5bb26cb2e95754de.tar.gz eclipse.platform.swt-b8f279dbff859535eb322f2c5bb26cb2e95754de.tar.xz eclipse.platform.swt-b8f279dbff859535eb322f2c5bb26cb2e95754de.zip |
38914
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java | 1 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java | 24 |
2 files changed, 15 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index 0d85ff8e0c..e02ba78658 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -21,6 +21,7 @@ public class OS { /** Constants */ public static final int G_SIGNAL_MATCH_DATA = 1 << 4; public static final int GDK_2BUTTON_PRESS = 0x5; + public static final int GDK_3BUTTON_PRESS = 0x6; public static final int GDK_ACTION_COPY = 1 << 1; public static final int GDK_ACTION_MOVE = 1 << 2; public static final int GDK_ACTION_LINK = 1 << 3; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java index c24fc6d0af..0b0d8b64ab 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java @@ -592,6 +592,7 @@ int eventProc (int event, int data) { switch (gdkEvent.type) { case OS.GDK_BUTTON_PRESS: case OS.GDK_2BUTTON_PRESS: + case OS.GDK_3BUTTON_PRESS: case OS.GDK_BUTTON_RELEASE: case OS.GDK_MOTION_NOTIFY: { Control control = null; @@ -611,19 +612,22 @@ int eventProc (int event, int data) { } } while ((window = OS.gdk_window_get_parent (window)) != 0); if (window != 0 && forward && control != null) { - int oldWindow = gdkEvent.window; - double oldX = gdkEvent.x, oldY = gdkEvent.y; + GdkEventButton gdkEventButton = new GdkEventButton (); + OS.memmove (gdkEventButton, event, GdkEventButton.sizeof); + int oldWindow = gdkEventButton.window; + double oldX = gdkEventButton.x, oldY = gdkEventButton.y; int eventHandle = control.eventHandle (); - gdkEvent.window = OS.GTK_WIDGET_WINDOW (eventHandle); + gdkEventButton.window = OS.GTK_WIDGET_WINDOW (eventHandle); int [] origin_x = new int [1], origin_y = new int [1]; - OS.gdk_window_get_origin (gdkEvent.window, origin_x, origin_y); - gdkEvent.x = gdkEvent.x_root - origin_x [0]; - gdkEvent.y = gdkEvent.y_root - origin_y [0]; - OS.memmove (event, gdkEvent, GdkEventButton.sizeof); + OS.gdk_window_get_origin (gdkEventButton.window, origin_x, origin_y); + gdkEventButton.x = gdkEventButton.x_root - origin_x [0]; + gdkEventButton.y = gdkEventButton.y_root - origin_y [0]; + OS.memmove (event, gdkEventButton, GdkEventButton.sizeof); OS.gtk_main_do_event (event); - gdkEvent.window = oldWindow; - gdkEvent.x = oldX; gdkEvent.y = oldY; - OS.memmove (event, gdkEvent, GdkEventButton.sizeof); + gdkEventButton.window = oldWindow; + gdkEventButton.x = oldX; + gdkEventButton.y = oldY; + OS.memmove (event, gdkEventButton, GdkEventButton.sizeof); return 0; } } |