<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Christopher,<div><br></div><div>This is a bug. If you hide a stage while iconified the position and size properties are updated to incorrect values. I’ll enter a bug report. The fix looks straightforward.</div><div><br></div><div>We shouldn’t send move and size notifications when an HWND is iconified since its rectangle contains useless coordinates. We check for this at various points but missed one (namely when processing WM_SHOWWINDOW).</div><div><br></div><div>Martin</div><div><div><br><blockquote type="cite"><div>On Sep 2, 2025, at 2:08 PM, Christopher Schnick <crschnick@xpipe.io> wrote:</div><br class="Apple-interchange-newline"><div>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div><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>
</div>
</div></blockquote></div><br></div></body></html>