Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -59,6 +59,7 @@ public class MissedDragExitTest {

private static void initAndShowUI() {
f = new Frame("Test frame");
f.setUndecorated(true);
f.setBounds(FRAME_LOCATION,FRAME_LOCATION,FRAME_SIZE,FRAME_SIZE);

final DraggablePanel dragSource = new DraggablePanel();
Expand Down Expand Up @@ -101,7 +102,7 @@ public void run() {
Util.drag(r,
new Point(FRAME_LOCATION + FRAME_SIZE / 3, FRAME_LOCATION + FRAME_SIZE / 3),
new Point(FRAME_LOCATION + FRAME_SIZE / 3 * 2, FRAME_LOCATION + FRAME_SIZE / 3 * 2),
InputEvent.BUTTON1_MASK);
InputEvent.BUTTON1_DOWN_MASK);
Util.waitForIdle(r);

if (!dragExitCalled) {
Expand Down
9 changes: 7 additions & 2 deletions jdk/test/java/awt/regtesthelpers/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,13 @@ public static void waitTillShown(final Component comp) {
* {@code InputEvent.BUTTON3_MASK}
*/
public static void drag(Robot robot, Point startPoint, Point endPoint, int button) {
if (!(button == InputEvent.BUTTON1_MASK || button == InputEvent.BUTTON2_MASK
|| button == InputEvent.BUTTON3_MASK))
if (!(button == InputEvent.BUTTON1_MASK
|| button == InputEvent.BUTTON2_MASK
|| button == InputEvent.BUTTON3_MASK
|| button == InputEvent.BUTTON1_DOWN_MASK
|| button == InputEvent.BUTTON2_DOWN_MASK
|| button == InputEvent.BUTTON3_DOWN_MASK
))
{
throw new IllegalArgumentException("invalid mouse button");
}
Expand Down