I have made an undecorated window, and I have used this answer as a reference in order to make it minimizable when the user clicks on the taskbar icon. I have mainly used the "simplest" version in the answer, and it is working.
Recently, I have discovered one problem; although I can minimize/un-minimize the window by clicking on the taskbar icon, but the iconifiedProperty
does not change its value when the window is un-minimized - the Stage needs to receive another layout change (e.g. setMaximized(true)
) in order for iconifiedProperty
to transit to false
state.
I need to detect this change because I am also making the window not to be full-screen when it is maximized (See this bug, it includes a temporary workaround). Again, I can make the size of the maximized window take the full visual bounds of the screen, but when a maximized window is minimized and subsequently un-mininized, the window will revert to covering the taskbar (full-screen).
Any help would be appreciated.
Edit
An update on the problem. I just realized that iconifiedProperty
does not change only when the window is in maximized state.
I.e.
- Window is at maximized state.
- Window is minimized (no matter via
setIconified(true)
or click of taskbar icon). - Window is un-minimized by clicking on taskbar icon.
This will cause iconifiedProperty
to transit to true
in step 2, and will not go back to false
in step 3. Thereafter, repeating step 2 and 3 will not cause in the change of this property either.
This problem is not observed to happen if the window is not in maximized state, though.
Edit 2
Further testing shows that it has nothing to do with being undecorated - the iconified property change does not happen even on a normal maximized window.