Skip to content

Commit b4aa221

Browse files
Taizo KurashigePaul Hohensee
authored andcommitted
8159694: HiDPI, Unity, java/awt/dnd/DropTargetEnterExitTest/MissedDragExitTest.java
Reviewed-by: phh Backport-of: c3938ec18b4026d70d9654235dcd986d90344f5b
1 parent 1daca5f commit b4aa221

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

jdk/test/java/awt/dnd/DropTargetEnterExitTest/MissedDragExitTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,7 @@ public class MissedDragExitTest {
5959

6060
private static void initAndShowUI() {
6161
f = new Frame("Test frame");
62+
f.setUndecorated(true);
6263
f.setBounds(FRAME_LOCATION,FRAME_LOCATION,FRAME_SIZE,FRAME_SIZE);
6364

6465
final DraggablePanel dragSource = new DraggablePanel();
@@ -101,7 +102,7 @@ public void run() {
101102
Util.drag(r,
102103
new Point(FRAME_LOCATION + FRAME_SIZE / 3, FRAME_LOCATION + FRAME_SIZE / 3),
103104
new Point(FRAME_LOCATION + FRAME_SIZE / 3 * 2, FRAME_LOCATION + FRAME_SIZE / 3 * 2),
104-
InputEvent.BUTTON1_MASK);
105+
InputEvent.BUTTON1_DOWN_MASK);
105106
Util.waitForIdle(r);
106107

107108
if (!dragExitCalled) {

jdk/test/java/awt/regtesthelpers/Util.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,13 @@ public static void waitTillShown(final Component comp) {
323323
* {@code InputEvent.BUTTON3_MASK}
324324
*/
325325
public static void drag(Robot robot, Point startPoint, Point endPoint, int button) {
326-
if (!(button == InputEvent.BUTTON1_MASK || button == InputEvent.BUTTON2_MASK
327-
|| button == InputEvent.BUTTON3_MASK))
326+
if (!(button == InputEvent.BUTTON1_MASK
327+
|| button == InputEvent.BUTTON2_MASK
328+
|| button == InputEvent.BUTTON3_MASK
329+
|| button == InputEvent.BUTTON1_DOWN_MASK
330+
|| button == InputEvent.BUTTON2_DOWN_MASK
331+
|| button == InputEvent.BUTTON3_DOWN_MASK
332+
))
328333
{
329334
throw new IllegalArgumentException("invalid mouse button");
330335
}

0 commit comments

Comments
 (0)