On Tue, 11 Jul 2023 10:50:13 GMT, Tejesh R <[email protected]> wrote:

> The bug mentions about transparency issue on Linux which actually got 
> resolved with [JDK-8006421](https://bugs.openjdk.org/browse/JDK-8006421) fix. 
> Now there is another problem related to the bug, which is screen selection 
> going wrong during checking for new screen when the test is run. The problem 
> is that (As seen in the pictures attached in bug) the transparency is lost 
> for windows which are in screen 0 (default screen) too, which is not supposed 
> to happen where windows on screen 1 should have lost there transparency. The 
> main reason being the call to `toGlobal()` when window bounds are passed to 
> `checkIfOnNewScreen` method. I didn't get the actual reason for `toGlobal` 
> being used here (actually not required to check monitor number), but it 
> actually doubled the X position of the window [here]( 
> https://github.com/openjdk/jdk/blob/4b1403d06b99b91ddd89ad6e54669b0595f1f8e5/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java#L776).
>  Removing `toGlobal` solve the issue and neithe
 r didn't cause any regression (existing test + the reason `toGlobal()` was 
added [JDK-8143295](https://bugs.openjdk.org/browse/JDK-8143295)).
> 
> The automated test fails if GC is changed for windows within screen 0 
> (default screen). CI testing is green.

Suggested some minor changes. I ran the changes and test in CI as well, and it 
passed with a higher repetition test. Test looks fine to me on Linux.

test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java line 79:

> 77:                 .getScreenDevices();
> 78: 
> 79:         if(screens.length < 2) {

Suggestion:

        if (screens.length < 2) {

test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java line 80:

> 78: 
> 79:         if(screens.length < 2) {
> 80:             System.out.println("Testing aborted. Required min of 2 
> screens. Found : " + screens.length );

There are a few lines like this that exceed the line character limit.

test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java line 120:

> 118:                 double windowXPos = window.getBounds().getX();
> 119:                 double screen1Width = 
> screens[0].getDefaultConfiguration().getBounds().getWidth();
> 120:                 System.out.println("window x Position : " + windowXPos + 
> ", screen[0] width : " + screen1Width);

Line character limit

-------------

PR Review: https://git.openjdk.org/jdk/pull/14825#pullrequestreview-1525196838
PR Review Comment: https://git.openjdk.org/jdk/pull/14825#discussion_r1260312859
PR Review Comment: https://git.openjdk.org/jdk/pull/14825#discussion_r1260311802
PR Review Comment: https://git.openjdk.org/jdk/pull/14825#discussion_r1260313265

Reply via email to