<div dir="ltr">Hi,<div><br></div><div>I’d like to get your thoughts on what the expected behavior should be when setting the size of a window while it's in a maximized state.<br><br></div><div>Here are the options I’ve considered:<br><br>a) Ignore the resize while maximized, and when restored, revert to the size before it was maximized<br>b) Demaximize the window and apply the new size immediately<br>c) Ignore the resize request, but store the values and apply them upon restore<br><br>If I understood correctly, Martin mentioned that both macOS and Windows apply the resize immediately while keeping the window maximized.</div><div>Then, when the window is demaximized, it restores the previous (pre-maximized) size, which suggests behavior leaning toward option a.<br><br>For fullscreen mode, the expected behavior appears to align more with option c, as documented for Stage fullscreen.</div><div><br></div><div>-- Thiago.</div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Em sáb., 29 de mar. de 2025 às 09:24, Thiago Milczarek Sayão <<a href="mailto:thiago.sayao@gmail.com">thiago.sayao@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I did not find a bug report, so I did one and provided a fix:<div><br></div><div><a href="https://github.com/openjdk/jfx/pull/1748" target="_blank">https://github.com/openjdk/jfx/pull/1748</a></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em sáb., 29 de mar. de 2025 às 08:26, Thiago Milczarek Sayão <<a href="mailto:thiago.sayao@gmail.com" target="_blank">thiago.sayao@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><a class="gmail_plusreply" id="m_2988398710280461967m_-7523828988626786145m_4138217888673675929plusReplyChip-0" href="mailto:crschnick@xpipe.io" target="_blank">@Christopher Schnick</a> <br><div><br></div><div>Hi, did you open a bug? I have a fix for this.</div><div><br></div><div>Thanks</div><div><br></div><div>-- Thiago.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em seg., 17 de mar. de 2025 às 09:49, Christopher Schnick <<a href="mailto:crschnick@xpipe.io" target="_blank">crschnick@xpipe.io</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<p>So on Windows at least, it will change the width temporarily and
then revert back to the original width value. So you will receive
two width change events if you listen to the stage width property.
The maximized property is not changed.</p>
<p>I guess this also not optimal handling of this. Ideally, no
changes would be made in that case.<br>
</p>
<div>On 17/03/2025 10:53, Thiago Milczarek
Sayão wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi Christopher,
<div><br>
</div>
<div>It seems like a simple fix.</div>
<div><br>
</div>
<div>How does it behave on other platforms? Does it ignore the
resize, restore the window to its unmaximized state before
resizing, or keep it maximized while adjusting the unmaximized
size.</div>
<div><br>
</div>
<div>-- Thiago</div>
<div>
<div>
<div>
<div>
<div><span></span></div>
<span><br>
</span><span></span><span></span></div>
</div>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Em dom., 16 de mar. de 2025 às
05:25, Christopher Schnick <<a href="mailto:crschnick@xpipe.io" target="_blank">crschnick@xpipe.io</a>>
escreveu:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hello,<br>
<br>
we encountered an issue on Linux where resizing the stage
while it is maximized breaks the size of the scene. You
can see a video of this at <a href="https://github.com/xpipe-io/xpipe/issues/485" target="_blank">https://github.com/xpipe-io/xpipe/issues/485</a>
. The root cause is that the stage size is modified.<br>
<br>
When doing this, it temporarily or permanently switches to
the size the stage had prior to being maximized, leading
to either a flicker or a permanently broken scene that has
the wrong size. This happens on Gnome and KDE for me with
the latest JavaFX ea version.<br>
<br>
Here is a simple reproducer:</p>
<div style="background-color:rgb(30,31,34);color:rgb(188,190,196)">
<pre style="font-family:"JetBrains Mono",monospace"><span style="color:rgb(207,142,109)">import </span>javafx.application.Application;
<span style="color:rgb(207,142,109)">import </span>javafx.scene.Scene;
<span style="color:rgb(207,142,109)">import </span>javafx.scene.control.Button;
<span style="color:rgb(207,142,109)">import </span>javafx.scene.layout.Region;
<span style="color:rgb(207,142,109)">import </span>javafx.scene.layout.StackPane;
<span style="color:rgb(207,142,109)">import </span>javafx.stage.Stage;
<span style="color:rgb(207,142,109)">import </span>java.io.IOException;
<span style="color:rgb(207,142,109)">import </span>java.util.Base64;
<span style="color:rgb(207,142,109)">public class </span>MaximizeLinuxBug <span style="color:rgb(207,142,109)">extends </span>Application {
<span style="color:rgb(179,174,96)">@Override
</span><span style="color:rgb(179,174,96)"> </span><span style="color:rgb(207,142,109)">public void </span><span style="color:rgb(86,168,245)">start</span>(Stage stage) <span style="color:rgb(207,142,109)">throws </span>IOException {
Scene scene = <span style="color:rgb(207,142,109)">new </span>Scene(createContent(), <span style="color:rgb(42,172,184)">640</span>, <span style="color:rgb(42,172,184)">480</span>);
<span style="color:rgb(207,142,109)">var </span>s = <span style="color:rgb(106,171,115)"><a>"data:text/css;base64,"</a> </span>+ Base64.<span style="font-style:italic">getEncoder</span>().encodeToString(createCss().getBytes());
scene.getStylesheets().add(s);
stage.setTitle(<span style="color:rgb(106,171,115)">"Hello!"</span>);
stage.setScene(scene);
stage.show();
stage.centerOnScreen();
stage.setMaximized(<span style="color:rgb(207,142,109)">true</span>);
}
<span style="color:rgb(207,142,109)">private </span>String <span style="color:rgb(86,168,245)">createCss</span>() {
<span style="color:rgb(207,142,109)">return </span><span style="color:rgb(106,171,115)">"""
</span><span style="color:rgb(106,171,115)"> * {
</span><span style="color:rgb(106,171,115)"> -fx-border-color: red;
</span><span style="color:rgb(106,171,115)"> -fx-border-width: 1;
</span><span style="color:rgb(106,171,115)"> }
</span><span style="color:rgb(106,171,115)"> """</span>;
}
<span style="color:rgb(207,142,109)">private </span>Region <span style="color:rgb(86,168,245)">createContent</span>() {
<span style="color:rgb(207,142,109)">var </span>button = <span style="color:rgb(207,142,109)">new </span>Button(<span style="color:rgb(106,171,115)">"Click me!"</span>);
button.setOnAction(event -> {
<span style="color:rgb(207,142,109)">var </span>w = <span style="color:rgb(199,125,187)">button</span>.getScene().getWindow();
w.setWidth(w.getWidth() - <span style="color:rgb(42,172,184)">1</span>);
event.consume();
});
<span style="color:rgb(207,142,109)">var </span>stack = <span style="color:rgb(207,142,109)">new </span>StackPane(button);
<span style="color:rgb(207,142,109)">return </span>stack;
}
<span style="color:rgb(207,142,109)">public static void </span><span style="color:rgb(86,168,245)">main</span>(String[] args) {
<span style="font-style:italic">launch</span>();
}
}</pre>
</div>
<p><br>
Best<br>
Christopher Schnick<br>
</p>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote></div>
</blockquote></div>
</blockquote></div>