On Wed, 30 Jul 2025 22:17:15 GMT, Martin Fox <m...@openjdk.org> wrote:

>> Thiago Milczarek Sayao has updated the pull request with a new target base 
>> due to a merge or a rebase. The pull request now contains 60 commits:
>> 
>>  - Simplify notify_fullscreen
>>  - Merge branch 'master' into 8354943
>>  - Remove repaint call (8351867 is fixed)
>>  - Merge branch 'master' into 8354943
>>  - Remove unused const
>>  - Remove wrong call to enter_fullscreen
>>  - Review changes
>>  - Use process_expose
>>  - Min / Max size improvements
>>  - Invalidate view size on new view
>>  - ... and 50 more: https://git.openjdk.org/jfx/compare/bc433da8...d1842395
>
> tests/system/src/test/java/test/javafx/stage/CenterOnScreenTest.java line 108:
> 
>> 106:     }
>> 107: 
>> 108:     private void assertStageCentered(StageStyle stageStyle, boolean 
>> useSceneSize) {
> 
> On Windows the size of a DECORATED or EXTENDED window includes an area around 
> the window containing the invisible drag handles. After sizeToScene is called 
> on my Windows 11 system a DECORATED or EXTENDED window will be 26 units wider 
> than the scene to account for these handles (on my Mac the window will be the 
> same width as the scene).
> 
> In this test you use a hefty delta for DECORATED windows and a smaller one 
> for EXTENDED and you use the same delta for both width and height. This is 
> causing the centerOnScreenAfterShownWithSceneSize and 
> centerOnScreenWhenShownWithSceneSize test to fail along the X axis for 
> EXTENDED stages since the delta isn't big enough.
> 
> You might consider querying the stage for it's frame and ensure that the 
> center of the frame is where you expect it rather than make any assumptions 
> about how the scene width relates to the window width.

The test still looks incorrect. You're passing in posX and posY as the 
tolerance deltas.

I'm not sure what you're testing here. There's an internal algorithm that sets 
the window's x and y coordinate to center it. You're replicating that algorithm 
here and testing whether the window has the same x and y values. If you're 
concerned that the platform code didn't actually move the window you would need 
to use a robot to sample a pixel and verify that the window is where you 
expect. Or was there some other centering problem you saw on Linux?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1789#discussion_r2276980571

Reply via email to