<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.</p>
<p>This happens in the latest ea build.</p>
<p>Here is a reproducer:</p>
<div style="background-color:#1e1f22;color:#bcbec4">
<pre
style="font-family:'JetBrains Mono',monospace;font-size:9,8pt;"><span
style="color:#cf8e6d;">public static void </span><span
style="color:#56a8f5;">main</span>(String[] args) {
Platform.<span style="font-style:italic;">startup</span>(() -> {
<span style="color:#cf8e6d;">var </span>stage = <span
style="color:#cf8e6d;">new </span>Stage();
stage.setWidth(<span style="color:#2aacb8;">500</span>);
stage.setHeight(<span style="color:#2aacb8;">500</span>);
stage.show();
stage.setIconified(<span style="color:#cf8e6d;">true</span>);
stage.xProperty().subscribe(number -> System.<span
style="color:#c77dbb;font-style:italic;">out</span>.println(number));
stage.hide();
stage.show();
});
}</pre>
</div>
<p>Best<br>
Christopher Schnick</p>
</body>
</html>