xdsswar / nfx-lib

JavaFx/JNI library designed exclusively for Windows (Tested on Windows 11). It enhances your Java applications by allowing advanced manipulation of the Stage's title bar and custom decorations.
29 stars 6 forks source link

If the window hide() and then show() , the default titlebar will appear. #4

Open leck995 opened 2 weeks ago

leck995 commented 2 weeks ago

I tested on both Windows 10 and Windows 11, and the above situation occurs. The default titlebar appears, and I tried calling initStyle(StageStyle.TRANSPARENT), but it loses the functionality of the window decorations. 2024-09-30 20 09 11

Here is the demo code, which I modified slightly to demonstrate.

       private UndecoratedExample undecoratedExample;

       openUndecoratedBtn.setOnAction(event -> {
            if (undecoratedExample != null) {
                undecoratedExample.show();
                return;
            }
            undecoratedExample = new UndecoratedExample();
            undecoratedExample.setTitle("Undecorated NfxWindow Demo");
            undecoratedExample.getIcons().add(
                    new Image(Assets.load("/icon.png").toExternalForm())
            );
            undecoratedExample.show();
        });
xdsswar commented 2 weeks ago

I will look into it, but I have use it on windows 11 only with javafx 17 and works ok.

leck995 commented 2 weeks ago

I was previously using JDK 21, and I just tried JDK 17, but it still have the same bug. My system is Windows 11 business version 23H2.

xdsswar commented 2 weeks ago

Im testing but it seems to work. image

leck995 commented 2 weeks ago

It's strange. I've tested several computers, and this phenomenon occurs on all of them; Every time I hide a window and then show it again, a bug appears. If it can't be reproduced, there's nothing I can do about it.Thank you for your response. GIF 2024-10-1 12-22-31

leck995 commented 2 weeks ago

By the way, this window object is global, and the second appearance does not create a new window.

xdsswar commented 1 week ago

I have been testing in all my computers (Windows 11) and all is working, not so sure what's is causing the issue for you. If you can check in your user folder under C/Users/YourUser , there should be a folder named .nfx or starting with that prefix, delete it and try again. This is a new app test and all is working great

In my laptop image

In my desktop https://streamable.com/7m8cw4