Skip to content

Commit

Permalink
6829250: Reg test: java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest…
Browse files Browse the repository at this point in the history
….java fails in Windows

Backport-of: f56396f1689ea7e13dea78dcb1d14dcce94da898
  • Loading branch information
Victor Rudometov authored and Paul Hohensee committed Oct 10, 2022
1 parent 34b1178 commit 9ddc8b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java 8168388 lin
java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowRetaining.java 6829264 generic-all
java/awt/datatransfer/DragImage/MultiResolutionDragImageTest.java 8080982 generic-all
java/awt/datatransfer/SystemFlavorMap/AddFlavorTest.java 8079268 linux-all
java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java 6829250 windows-all
java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java 8159252 windows-all
java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 8203047 macosx-all
java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java 8073636 macosx-all
Expand Down
11 changes: 8 additions & 3 deletions test/jdk/java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 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 @@ -51,7 +51,6 @@ public static void main(String[] args)
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gds = ge.getScreenDevices();
for (GraphicsDevice gd : gds) {

GraphicsConfiguration gc = gd.getDefaultConfiguration();
Rectangle gcBounds = gc.getBounds();
Insets gcInsets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
Expand Down Expand Up @@ -100,7 +99,13 @@ public static void main(String[] args)
gcBounds.y + gcBounds.height - fBounds.y - fBounds.height,
gcBounds.x + gcBounds.width - fBounds.x - fBounds.width);

if (!expected.equals(gcInsets))
// On Windows 10 and up system allows undecorated maximized windows
// to be placed over the taskbar so calculated insets might
// be smaller than reported ones depending on the taskbar position
if (gcInsets.top < expected.top
|| gcInsets.bottom < expected.bottom
|| gcInsets.left < expected.left
|| gcInsets.right < expected.right)
{
passed = false;
System.err.println("Wrong insets for GraphicsConfig: " + gc);
Expand Down

1 comment on commit 9ddc8b0

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.