Hi @Tremus, this mirrors our Discord conversation from a while ago. I'm seeing the GUI open with twice the appropriate scale in Windows 11 Cubase. Even if I resize the window and then close it, it will reopen with twice the scale it previously had when I closed it. Here's my last comment from the Discord thread for reference:
I have a dumb but effective workaround that's handling all the edge cases I've thrown at it so far. If the host is DPI-unaware, leave the scaling as is. If DPI-aware, set the default scaling to the display scaling setting in Windows (handling hosts like Reason that don't implement scaling at all), but keep a record of whether cplug_setScaleFactor has been called yet so on the first scaling call from the host (if the host implements scaling), reset the scale to 1.0 since some hosts (Cubase for one) make assumptions about the current window dimensions based on what scale the program thinks the plugin GUI is. So if you were already scaled to 2x and Cubase sets the scale, it may wrongly resize the window because it thought you were at starting at 1x scale. That's my understanding at least. Anyway, it works well and would only require minimal changes to the CPLUG windowing extensions
This fix was based on the CPLUG windowing library from before it was refactored, and I haven't yet updated it to run on the current commit, but the basic idea shouldn't change (and should carry over to sokol gfx fine as well). Does this make sense?
Otherwise, I'm loving the slickness of how you've gone about this! And I'd been thinking about a way to involve sokol as well, so great job all around!
Hi @Tremus, this mirrors our Discord conversation from a while ago. I'm seeing the GUI open with twice the appropriate scale in Windows 11 Cubase. Even if I resize the window and then close it, it will reopen with twice the scale it previously had when I closed it. Here's my last comment from the Discord thread for reference:
This fix was based on the CPLUG windowing library from before it was refactored, and I haven't yet updated it to run on the current commit, but the basic idea shouldn't change (and should carry over to sokol gfx fine as well). Does this make sense?
Otherwise, I'm loving the slickness of how you've gone about this! And I'd been thinking about a way to involve sokol as well, so great job all around!