diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java index 03f18f19925..919ecbe1402 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java @@ -1188,9 +1188,7 @@ public void setEnabled (boolean enabled) { * */ public void setLocation (int x, int y) { - checkWidget (); - int zoom = getZoom(); - setLocationInPixels(DPIUtil.scaleUp(x, zoom), DPIUtil.scaleUp(y, zoom)); + setLocation(new Point(x, y)); } void setLocationInPixels (int x, int y) { @@ -1227,7 +1225,7 @@ void setLocationInPixels (int x, int y) { public void setLocation (Point location) { checkWidget (); if (location == null) error (SWT.ERROR_NULL_ARGUMENT); - location = DPIUtil.scaleUp(location, getZoom()); + location = getDisplay().translateLocationInPixelsInDisplayCoordinateSystem(location.x, location.y); setLocationInPixels(location.x, location.y); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java index a0b677dc22b..b75b05539a2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java @@ -1651,8 +1651,8 @@ boolean showMenu (int x, int y) { boolean showMenu (int x, int y, int detail) { Event event = new Event (); - int zoom = getZoom(); - event.setLocation(DPIUtil.scaleDown(x, zoom), DPIUtil.scaleDown(y, zoom)); + Point mappedLocation = getDisplay().translateLocationInPointInDisplayCoordinateSystem(x, y); + event.setLocation(mappedLocation.x, mappedLocation.y); event.detail = detail; if (event.detail == SWT.MENU_KEYBOARD) { updateMenuLocation (event); @@ -1663,7 +1663,7 @@ boolean showMenu (int x, int y, int detail) { if (!event.doit) return true; Menu menu = getMenu (); if (menu != null && !menu.isDisposed ()) { - Point locInPixels = DPIUtil.scaleUp(event.getLocation(), zoom); // In Pixels + Point locInPixels = DPIUtil.scaleUp(event.getLocation(), getZoom()); // In Pixels if (x != locInPixels.x || y != locInPixels.y) { menu.setLocation (event.getLocation()); }