how can i detect or disable minimize event

I have a dialog from a library. I need to prevent user from minimizing the dialog, or possibly let them but have a way to restore it. As of now the only way i see to restore dialog window is to minimize and restore the entire LO window with manual intervention.

I have registered an XTopWindowListener and an XWindowListener. Both are listening at the same time. A few of the events work in either case, but

the top windowminimized event does not occur (as far as i can tell)
[edit: i figured out it is firing, but i dont know what to put in the method]

the dialog windowhiding event does not occur (and is probably irrelevant?)

there is no dialog windowminimizing / minimized event

Dont know if it matters, but my system is manjaro with plasma 5.18.3.

follow up: i think the Plasma desktop does have something to do with it. There is no minimize button on the dialog window using Ubuntu (Gnome i think) or Windows 10.