goxr3plus / FX-BorderlessScene

💠 Undecorated JavaFX Scene with implemented move, resize, minimise, maximise, close and Windows Aero Snap controls.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minimizing undecorated stage

Marcoral opened this issue · comments

Undecorated stages have one annoying property - they don't minimize as you click at its icon on OS task bar in opposite to decorated ones. I found a solution that actually seem to work, but I have it tested only on Win7. I am not familiar with JNA at all and I am not sure whether we should go that far with enhancing a project as it would require additional library to work. What do you think about it?

In the example i have added a button which calls 'stage.minimize()'.

Hm i saw the link.... It seems quite a trouble to get into this.

I am not familiar a lot also with JNA. Let's keep it here for future discussion.

Do you think it's a big problem for the end user :( ?

I got it working in around 5 minutes: i added JNA to maven dependencies and just copy-pasted it in the right place (stage must be visible to use this). But as it uses native API, I think it might behave strangely on various pratforms (or maybe everything would be fine - I don't have a possibility to test that). I think it is really nice feature and lack of it personally irritates me, but it's nothing that important to do it right now. I just wanted to know what do you think about it in general.
Nevertheless, I suggest to leave this issue open

Keep this opened i like the idea, how many megabytes the JNA libraries are, are they cross platform or we have to pack a different one for every platform?

As I mentioned, at the moment I know nothing more than you, but it looks like JNA aims to provide ease of use and it is really lightweight - whole library weights below 1MB. It would be great if someone could test it on other platforms than Windows after all.

@Marcoral I have tried installing MAC os it in VM but t is so slow :(

Maybe one day I will check it. I looked into a source of JNA and I got the impression that there is a good chance that everything will work out - basic API should work cross-platform, but you can also perform platform-dependent operations if you wish, as there are methods like Platform.isWindows(), Platform.isMac() etc. When I find some free time, I will try to Play a bit more with it and I will get you know if I find out something interesting (there may be more of cool stuff related)

You can even add it for Windows now if you want. Implementing it on Mac and Linux can be added on todo.

At least let's have it on the most popular platform.

I will help you.

Let's do it for windows :))

Here it is:
https://github.com/goxr3plus/FX-BorderlessScene/tree/experimental

I put it in new, "experimental" branch, because, as I said, I am not sure whether it will work correctly on every platform. If it turns out that everything is ok, we will probably merge it into the master one.

@Marcoral I tested it now , i liked it , merged to master . Made a new release => https://github.com/goxr3plus/FX-BorderlessScene/releases/tag/4.3.0

Also updated experimental to match master.

There is a weird warning at the starting of the application.

May 09, 2019 11:02:54 AM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.181

where is this coming from ?

Ah okay [fixed it] (913418f)

@Marcoral Can you help me merge this pull request if you have time :) ? #10