pplux / imgui-app

Dear IMGUI + Render + Window handling, amalgamation in two files ready to use
MIT License
165 stars 17 forks source link

How to hide and unhide OS-level window (X11)? #4

Closed diovudau closed 1 year ago

diovudau commented 1 year ago

Hello,

I want to hide and unhide the complete program window. The program is controlled through an external MIDI controller which sends the signals to hide and show. I am personally on X11 where this is called Unmap() and Map(), but other OSes need something else of course.

sokol.h has private functions to do this: _SOKOL_PRIVATE void _sapp_x11_show_window(void) and _SOKOL_PRIVATE void _sapp_x11_hide_window(void).

I want to avoid editing sokol.h and imgui.h. Any recommendation for a best practise how to extend imgui-app here?

diovudau commented 1 year ago

I tried to read all the code and I don't think it is possible without changing sokol.h and imgui_app.cpp .

Is there some kind of hacky C or C++ magic to access these functions anyway?

_SOKOL_PRIVATE bool _sapp_x11_window_visible(void)
_SOKOL_PRIVATE void _sapp_x11_show_window(void)
_SOKOL_PRIVATE void _sapp_x11_hide_window(void)
pplux commented 1 year ago

We can expose them, let me look into those :)