Skip to content
Snippets Groups Projects
Commit 933587a0 authored by Andrew Lu's avatar Andrew Lu
Browse files

8280990: [XWayland] XTest emulated mouse click does not bring window to front

Backport-of: d2d78ad18e0b5d2a6a62f9c97ceec5592fa1de2e
parent 234bf865
Branches
Tags
No related merge requests found
/*
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024, 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
......@@ -35,6 +35,9 @@ public class FrameToFrontModelessTest {
private boolean isModeless;
private static final boolean IS_ON_WAYLAND =
System.getenv("WAYLAND_DISPLAY") != null;
public FrameToFrontModelessTest(boolean modeless) throws Exception {
isModeless = modeless;
robot = new ExtendedRobot();
......@@ -76,6 +79,9 @@ public class FrameToFrontModelessTest {
robot.waitForIdle(delay);
// show the right frame appear on top of the dialog
if (IS_ON_WAYLAND) {
rightFrame.toFront();
}
rightFrame.clickDummyButton(robot);
robot.waitForIdle(delay);
......
/*
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024, 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
......@@ -45,6 +45,9 @@ public class TestDialog extends Dialog implements ActionListener,
public static int delay = 500;
public static int keyDelay = 100;
private static final boolean IS_ON_WAYLAND =
System.getenv("WAYLAND_DISPLAY") != null;
public TestDialog(Frame frame) {
super(frame);
initializeGUI();
......@@ -287,6 +290,9 @@ public class TestDialog extends Dialog implements ActionListener,
String message,
Button b) throws Exception {
focusGained.reset();
if (IS_ON_WAYLAND) {
toFront();
}
clickInside(robot);
focusGained.waitForFlagTriggered();
assertTrue(focusGained.flag(),
......@@ -303,6 +309,9 @@ public class TestDialog extends Dialog implements ActionListener,
String message,
Button b) throws Exception {
focusGained.reset();
if (IS_ON_WAYLAND) {
toFront();
}
clickInside(robot);
robot.waitForIdle(delay);
......
/*
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024, 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
......@@ -43,6 +43,8 @@ public class TestFrame extends Frame implements ActionListener,
public static int delay = 500;
public static int keyDelay = 100;
private static final boolean IS_ON_WAYLAND =
System.getenv("WAYLAND_DISPLAY") != null;
public TestFrame() {
super();
......@@ -251,7 +253,7 @@ public class TestFrame extends Frame implements ActionListener,
String message) throws Exception {
dummyClicked.reset();
clickButton(dummyButton, robot);
dummyClicked.waitForFlagTriggered();
dummyClicked.waitForFlagTriggered(attempts);
String msg = "Clicking the frame Dummy button " + (refState ?
"did not trigger an action." :
......@@ -277,6 +279,9 @@ public class TestFrame extends Frame implements ActionListener,
String message,
Button b) throws Exception {
focusGained.reset();
if (IS_ON_WAYLAND) {
toFront();
}
clickInside(robot);
focusGained.waitForFlagTriggered();
......@@ -293,6 +298,9 @@ public class TestFrame extends Frame implements ActionListener,
String message,
Button b) throws Exception {
focusGained.reset();
if (IS_ON_WAYLAND) {
toFront();
}
clickInside(robot);
robot.waitForIdle(delay);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment