Invalid stage iconified coordinates on Windows

Christopher Schnick crschnick at xpipe.io
Tue Sep 2 21:08:15 UTC 2025


Hello,

I encountered an issue on Windows where the xProperty() and yProperty() 
of stages will be set to the special value -32000 when an iconified 
stage is closed. Simply calling .setIconified(true) on a stage and 
closing the window in the taskbar sends updates to any listeners with 
this value.

I understand that in the win32 API, this value is used to indicate that 
the window is iconified. But in my opinion the JavaFX state should not 
return that and instead keep the last x/y coordinates of where it was 
when it was iconified, so I assume that this is a bug.

In practice, this breaks various situations in which the application 
will store the last window coordinates for the next time it is opened. 
If the application is closed while the stage was iconified, the stage 
won't show again as it is off the screen.

This happens in the latest ea build.

Here is a reproducer:

public static void main(String[] args) {
     Platform.startup(() -> {
         var stage =new Stage();
         stage.setWidth(500);
         stage.setHeight(500);
         stage.show();
         stage.setIconified(true);
         stage.xProperty().subscribe(number -> System.out.println(number));
         stage.hide();
         stage.show();
     });
}

Best
Christopher Schnick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20250902/5fd8f2fe/attachment.htm>


More information about the openjfx-dev mailing list