Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanis Danisevskis2018-02-10 00:15:35 +0000
committerSravan Kumar Lakkimsetti2018-02-14 08:35:35 +0000
commit34bfe2b05ea6e6107d7a1aeae76e639811959eb5 (patch)
tree51bb2a666c1d85f7dd6447249479462c49b31a01
parent8e6c786f24d18aae455461982669263ba909ce1f (diff)
downloadeclipse.platform.swt-34bfe2b05ea6e6107d7a1aeae76e639811959eb5.tar.gz
eclipse.platform.swt-34bfe2b05ea6e6107d7a1aeae76e639811959eb5.tar.xz
eclipse.platform.swt-34bfe2b05ea6e6107d7a1aeae76e639811959eb5.zip
Bug 529327: [GTK3] [hidpi] Dragging and dropping editor tabs does not work when "Scale for menu and title bar" (Unity/Ubuntu Display Settings) is other than "1"
org/eclipse/swt/widgets/Control.java (gtk) Applies DPIUtil.autoScaleDown to mouse event coordinates before submitting to sendDragEvent. Signed-off-by: Janis Danisevskis <werwurm@gmail.com> Change-Id: Ib1e37446f257b8e82537ecd059ae8440561e919b
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java6
1 files changed, 4 insertions, 2 deletions
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 618caa278a..dfad7677bd 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
@@ -3284,7 +3284,8 @@ long /*int*/ gtk_button_press_event (long /*int*/ widget, long /*int*/ event, bo
*/
if (OS.isX11()) { // Wayland
if (dragging) {
- sendDragEvent (gdkEvent.button, gdkEvent.state, (int) gdkEvent.x, (int) gdkEvent.y, false);
+ Point scaledEvent = DPIUtil.autoScaleDown(new Point((int)gdkEvent.x, (int) gdkEvent.y));
+ sendDragEvent (gdkEvent.button, gdkEvent.state, scaledEvent.x, scaledEvent.y, false);
if (isDisposed ()) return 1;
}
}
@@ -3622,7 +3623,8 @@ long /*int*/ gtk_motion_notify_event (long /*int*/ widget, long /*int*/ event) {
GdkEventButton gdkEvent1 = new GdkEventButton ();
OS.memmove (gdkEvent1, event, GdkEventButton.sizeof);
if (gdkEvent1.type == OS.GDK_3BUTTON_PRESS) return 0;
- if (sendDragEvent (gdkEvent1.button, gdkEvent1.state, (int) gdkEvent1.x, (int) gdkEvent1.y, false)){
+ Point scaledEvent = DPIUtil.autoScaleDown(new Point((int)gdkEvent1.x, (int) gdkEvent1.y));
+ if (sendDragEvent (gdkEvent1.button, gdkEvent1.state, scaledEvent.x, scaledEvent.y, false)){
return 1;
}
}

Back to the top