Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER for Linux

Reply
 
Thread Tools Display Modes
Old 09-10-2019, 01:29 PM   #1
baconpaul
Human being with feelings
 
Join Date: Sep 2019
Posts: 28
Default Reaper Linux VST3 is stealing 8 pixels from me (FIXED)

Hi!

I'm one of the devs on surge (https://surge-synthesizer.github.io/) and we actually have the VST3 version of our plugin working on Linux. Reaper works almost perfectly with Linux VST3 and the nightly of Surge

But it seems when we display the VST3 in Linux, our plugin gets clipped by about 8 pixels. Almost like the whole thing is being drawn in a rect which is .offset(4,4) or something.

https://github.com/surge-synthesizer/surge/issues/1144

there's an issue with screenshots and so on.

Is there something about the Reaper VST3 implementation which changes the sizing? Is there something I should do in my code to compensate for this? Is this a reaper bug? (Is it a surge bug?)

These are all questions I'm not sure of the answer to, but the Reaper surge users tell me that this forum is super friendly and the devs are responsive, so I figured i would ask it over here and see if you have any ideas.

Thanks for your consideration!

Paul
baconpaul is offline   Reply With Quote
Old 09-15-2019, 01:25 PM   #2
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 24,859
Default

@Justin, would be really nice to give some input here. Thanks!
EvilDragon is offline   Reply With Quote
Old 09-15-2019, 06:13 PM   #3
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 16,117
Default

Hi thanks for bringing this to our attention!

I'm looking at the code now -- it appears your IPlugView::canResize() returns kResultTrue, meaning that the plug-in supports variable sizing. In this case, implementing IPlugView::checkSizeConstraint() would probably help?
Justin is offline   Reply With Quote
Old 09-15-2019, 11:46 PM   #4
sub26nico
Human being with feelings
 
sub26nico's Avatar
 
Join Date: May 2014
Location: France
Posts: 261
Default

Quote:
Originally Posted by Justin View Post
Hi thanks for bringing this to our attention!

I'm looking at the code now -- it appears your IPlugView::canResize() returns kResultTrue, meaning that the plug-in supports variable sizing. In this case, implementing IPlugView::checkSizeConstraint() would probably help?
Resizing now works (tested with the vst3) but the issue at the bottom (pixels missing) is still there.
sub26nico is offline   Reply With Quote
Old 09-16-2019, 03:48 AM   #5
baconpaul
Human being with feelings
 
Join Date: Sep 2019
Posts: 28
Default

Yeah the 8 pixel clip which only happens on linux is what’s confusing me. I send a resize message to go to a certain size, and I get sent to that certain size, then I get drawn about 8 pixels shy of that on linux only.

I’ll check that constraint API this week though and see if that helps; andupdate this thread if so. Thanks!
baconpaul is offline   Reply With Quote
Old 09-16-2019, 05:17 AM   #6
baconpaul
Human being with feelings
 
Join Date: Sep 2019
Posts: 28
Default

Alright here's what's happening

I put print statements in the place where I call IPlugFrame::resizeView and also where I get called back in IPlugFrame:nSize and IPlugFrame::checkSizeConstraint (which I have now implemented).

On macOS I get the following when I resize (which I do by doing "menu/zoom/zoom to 125%" in this case:

```
Asking to resize to 1130 677
checkSizeConstraint 0 1130 1130x677
onSize 0 1130 1130x677
```

whereas on Linux I get this

```
Asking to resize to 1130 677
checkSizeConstraint 0 1122 1122x669
onSize 0 1122 1122x669
```

so yeah, for some reason you are just taking 8 pixels away from my desired size. But only in Reaper. And only on Linux.

So I guess I could code defensively around this. looks like in checksizeconstraint I can overrule you to tell you the size I want, after I told you the size I want

Is that the right solution? Why does only linux and only reaper do this in the VST3? Before I write that bit of code (which is a bit painful of course because the size I requested is not handed to me just the size you want to give me), I want to make sure this is what you intended Reaper/Linux to do.

Thanks
baconpaul is offline   Reply With Quote
Old 09-16-2019, 06:08 AM   #7
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 16,117
Default

Fixing on the REAPER side for the next builds
Justin is offline   Reply With Quote
Old 09-16-2019, 06:30 AM   #8
SmajjL
Human being with feelings
 
Join Date: Nov 2013
Posts: 2,881
Default

Quote:
Originally Posted by EvilDragon View Post
Quote:
Originally Posted by baconpaul View Post

Quote:
Originally Posted by Justin View Post
SmajjL is offline   Reply With Quote
Old 09-16-2019, 07:08 AM   #9
baconpaul
Human being with feelings
 
Join Date: Sep 2019
Posts: 28
Default

Awesome! Thank you!
baconpaul is offline   Reply With Quote
Old 09-16-2019, 02:04 PM   #10
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 16,117
Default

Latest +dev build should fix this!
Justin is offline   Reply With Quote
Old 09-16-2019, 02:13 PM   #11
sub26nico
Human being with feelings
 
sub26nico's Avatar
 
Join Date: May 2014
Location: France
Posts: 261
Default

Quote:
Originally Posted by Justin View Post
Latest +dev build should fix this!
It works, thanks @Justin !
sub26nico is offline   Reply With Quote
Old 02-16-2020, 09:08 AM   #12
acebone
Human being with feelings
 
Join Date: Oct 2017
Location: Copenhagen, Denmark
Posts: 229
Default

What a happy ending!
acebone is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.