lv2 / pugl

A minimal portable API for embeddable GUIs
https://gitlab.com/lv2/pugl/
ISC License
174 stars 34 forks source link

Fix creation zero-sized uis in jalv, ardour #100

Closed sjaehn closed 1 year ago

sjaehn commented 1 year ago

Me again ;-). Now I found a solution for the 2 years old issue #42 which is closed but not fixed yet.

Problem description: Pugl-based Plugin UIs are realized in jalv and ardour with size zero (or maybe (1, 1) - I'm not sure) if no ui_resize() (provided as LV2 feature) is called instantly. Even if puglSetSize() or puglSetSizeHint() is called prior puglRealize(). jalv addidtionally prints error messages on the screen. To visualize the problem (jalv with B.Amp at 100x100 (but not displayed) is in top left): Bildschirmfoto von 2023-02-18 21-46-22

ui:resize became deprecated as requested by faktx (AFAIK, didn't check). The manual resize mechanism (dragging) without resize as feature or interface fully works in jalv, ardour, reaper, zrythm, and carla. This was also one of the reasons to deprecate. Only the zero size-intitialized UIs in jalv and ardour stopped me to remove resize from my code, yet.

Solution: I saw that @brummer10 uses XSetWMNormalHints() instead of XSetNormalHints().

Tests: This works with all hosts tested (jalv, ardour, reaper, zrythm, carla, qtractor) without any error message. Also my standalone test apps (like B.Widgets widgetgallery) work as expected.

Note: Calling puglSetSize() or puglSetSizeHint() after puglRealize() still produces different host-dependent results. Only to keep in mind, no TODO for now.

drobilla commented 1 year ago

I don't really understand most of what you're saying there, to be honest, but it seems reasonable enough to me. Merged as 9b5a087, thanks.