rncbc / qtractor

Qtractor - An Audio/MIDI multi-track sequencer
https://qtractor.org
GNU General Public License v2.0
509 stars 88 forks source link

LV2 plugin UI resize (pugl / cairo / X11) in qtractor #293

Closed sjaehn closed 3 years ago

sjaehn commented 3 years ago

Hi Rui,

I'm currently busy to get a feature of my B.Music LV2 plugins (B.SEQuenzr, B.Jumblr, B.Oops, B.Choppr, ...) running in qtractor. UI scaling on resize. This works well with all other hosts I tested (with the notable exception of jalv.qt5). I tried a lot of things. But nothing works.

All my plugins use pugl, cairo, and X11. The plugins draw everything to cairo surfaces that are provided by pugl. Here and example with B.Choppr to visualize the problem.

Default window size: Bildschirmfoto von 2021-02-05 22-19-26

If I drag to resize the window: Bildschirmfoto von 2021-02-05 22-14-07 Note: The UI is scaled up in all other hosts I tested.

OK, I experienced that xevent.xconfigure events aren't forwarded for the plugin UI on window resize for Qt hosts. @ventosus advised me to use the extension_data resize function instead of (or in addition to) the lacking configure event. But the result is clipped to the original size: Bildschirmfoto von 2021-02-05 22-31-17

Debugging information showed me that the plugin is correctly informed about the new (resized) window size and thus draws a new resized plugin UI. But it's clipped as the size of the cairo xlib surface provided via puglGetContext() still has the default size. I think that this is an unintended behaviour. But what's the cause ?

rncbc commented 3 years ago

as a matter of fact it actually works if it gets to use SUIL instead of the native/own LV2UI X11 wrapper... thing is, the native wrapper is selected by default when summoning the lv2ui instance, and... how do you make it use the suil x11-in-qt5 wrapper, you ask? you'll have to enable View > Options... > Plugin > Editor > Select plugin's editor (GUI) if more than one are available. and then you select the "X11" option (not the top "X11 (native)" one) when asked to Select plugin's editor (GUI)...

meanwhile, I'll try to fix it on the native side, replicating what suil x11-in-qt5 is doing under its hood and get back to you asap.

thanks && cheers

sjaehn commented 3 years ago

Thanks for the info. I didn't know this option. However, I get exactly the result with "X11" as with "X11 (native)". Hmm....

rncbc commented 3 years ago

here using libsuil-x11-in-qt5 >= 0.10.8, dunno about you :)

sjaehn commented 3 years ago

Ah yes. I still stick at 0.10.6. I'll give it a try...

rncbc commented 3 years ago

maybe fixed in 2e9ae40, develop branch.

sjaehn commented 3 years ago

Indeed, suil >= 0.10.8 fixed the problem. :-) So simple.