goxr3plus / FX-BorderlessScene

💠 Undecorated JavaFX Scene with implemented move, resize, minimise, maximise, close and Windows Aero Snap controls.
142 stars 30 forks source link

Minimizing undecorated stage #20

Open Marcoral opened 5 years ago

Marcoral commented 5 years ago

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?

goxr3plus commented 5 years ago

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 :( ?

Marcoral commented 5 years ago

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

goxr3plus commented 5 years ago

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?

Marcoral commented 5 years ago

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.

goxr3plus commented 5 years ago

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

Marcoral commented 5 years ago

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)

goxr3plus commented 5 years ago

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 :))

Marcoral commented 5 years ago

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.

goxr3plus commented 5 years ago

Let's make it work only for Windows :) for the beggining and on the other platforms it will br marked as undone. I will add a method to detect the platform and the code will run only for Windows :)

On Wed, 8 May 2019, 16:32 Marcoral, notifications@github.com wrote:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/goxr3plus/FX-BorderlessScene/issues/20#issuecomment-490486949, or mute the thread https://github.com/notifications/unsubscribe-auth/AE3OFQHVTL5XLCCENAUHF4DPULI7HANCNFSM4HKZZBYQ .

goxr3plus commented 5 years ago

@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

goxr3plus commented 5 years ago

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 ?

goxr3plus commented 5 years ago

Ah okay [fixed it] (https://github.com/goxr3plus/FX-BorderlessScene/commit/913418f2311e39f113dd671dd5a76f1e26068a64)

goxr3plus commented 5 years ago

@Marcoral Can you help me merge this pull request if you have time :) ? https://github.com/goxr3plus/FX-BorderlessScene/pull/10