Skip to content

Commit

Permalink
8257414: Drag n Drop target area is wrong on high DPI systems
Browse files Browse the repository at this point in the history
  • Loading branch information
omikhaltsova committed Dec 29, 2020
1 parent 07c93fa commit ab3eb6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ private boolean processXdndPosition(XClientMessageEvent xclient) {
if (xwindow != null) {
/* Translate mouse position from root coordinates
to the target window coordinates. */
Point p = xwindow.toLocal(x, y);
Point p = xwindow.toLocal(xwindow.scaleDown(x), xwindow.scaleDown(y));
x = p.x;
y = p.y;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,17 +524,17 @@ private void processMouseMove(XMotionEvent xmotion) {
updateTargetWindow(xmotion);

if (dragProtocol != null) {
dragProtocol.sendMoveMessage(scaleDown(xmotion.get_x_root()),
scaleDown(xmotion.get_y_root()),
dragProtocol.sendMoveMessage(xmotion.get_x_root(),
xmotion.get_y_root(),
sourceAction, sourceActions,
xmotion.get_time());
}
}

private void processDrop(XButtonEvent xbutton) {
try {
dragProtocol.initiateDrop(scaleDown(xbutton.get_x_root()),
scaleDown(xbutton.get_y_root()),
dragProtocol.initiateDrop(xbutton.get_x_root(),
xbutton.get_y_root(),
sourceAction, sourceActions,
xbutton.get_time());
} catch (XException e) {
Expand Down

0 comments on commit ab3eb6a

Please sign in to comment.