Open Jeansen opened 2 years ago
So, I still do not know why enabling and disabling the visibility causes the application main thread to "reboot". Anyway, I solved my requirement by making one Window not a Window
but a Dialog
and set transparent to true and also it's width and height to 0.1.dp
. That way, I have a transparent 'pixel' (Dialog) on the screen that nobody sees and that has now appearance in the task bar or window list. The other Window will appear or disappear whenever - e.g. by pressing a predefined key - it's visibility is set to 'true' or false'.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
I would like to hide and show a window (so there is no trace in the taskbar). Therefore, I have a global hook and I set the visible state to true or false.
That works in principle, on Linux (Gnome 41, OpenJdk 17). But if there is only one window and it is set to visible = false, restoring the value to true kills the process (not the application). The UI gets completely recreated instead of simply being displayed (made visible) again. That take a lot of tome, compared to simply making the UI visible again and also destroys any remembered state! If I have another window which is visible and then do the same, I can easily toggle the visibility of the first window and no process gets recreated.
My question now is how do I achieve what works with two windows, but with only a single window?
Here's my gradle file and a sample main class. Hotkey is CTRL-SHIFT-F10