2020 and you can't create a undecorated window wit...
# tornadofx
m
2020 and you can't create a undecorated window without taskbar icon in JavaFX.
m
I needed this, so I created a C++ library that makes the system call to hide a window from the taskbar and I'm using it with JNI... pretty annoying. I need an always-on-top, click-transparent, undecorated, not-on-taskbar window (it's a small overlay).
a
m
@altavir that creates an undecorated window. It still shows up in the taskbar. Only utility windows don't show up in the taskbar with JavaFX. You can't mix stage styles. The only trick (making an invisible utility window, and making the undecorated window owned by that) doesn't work, at least on my system (Ubuntu).
a
All systems manage windows differently. What I mean is that you should broaden your search and look for general JavaFX solutions, not just tornado.
m
@altavir yes, I did it. That's how I know about the "trick" and that it doesn't work. In fact my message was about JavaFX, not TornadoFX. I mostly google for JavaFX, not TornadoFx. There is very little about it.
Thanks for the suggestion, @Marcin Wisniowski. I may do the same in future. I have to support both Linux and Windows 10, though.
@altavir Thanks for trying to help!
a
I believe that some manipulations with the task bar are possible, i've done something with icons as far as I remember. But it is system-specific.
m
@melatonina If you need it I can send you the Linux C++ code (single file), I will need to create a Windows port later on but for now I'm just developing on Linux.
a
It probably won't work on all linux window managers as well.
m
It just sets X11 window hints so it will work on all that respect them, which should should include all mainstream ones.
m
@Marcin Wisniowski I "saved" your message. I'll ask you for the C++ code in case I allocate some time to fix this issue. Thanks. It's very kind of you.
It's not a good moment to go native for me, now.
@Marcin Wisniowski could you share the C++ code?
m
@melatonina Yeah I've seen that bug tracker entry... Here is the relevant code: https://gitlab.com/Nohus/fastshot/-/blob/master/library.cpp Calling
setX11WindowHint(windowId, "_NET_WM_STATE_SKIP_TASKBAR", true);
will do the trick. The
windowId
I get from Java, you can find it in your windows from
com.sun.glass.ui.Window.getWindows()
, in the
nativeWindow
field of a
Window
. This repo also does other things but if you delete the screenshot parts you are left with a simple C++ library you can use from Java/Kotlin.
👍 1
m
@Marcin Wisniowski Thanks!