Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surge window resize does not size/render viewport correctly #5211

Closed
j5v opened this issue Oct 6, 2021 · 13 comments
Closed

Surge window resize does not size/render viewport correctly #5211

j5v opened this issue Oct 6, 2021 · 13 comments
Labels
Bug Report Item submitted using the Bug Report template Rebuild With JUCE Issues pertaining to porting Surge from VSTGUI to JUCE UI Issues related to UI look&feel
Milestone

Comments

@j5v
Copy link
Contributor

j5v commented Oct 6, 2021

Bug Description:
When I resize the Surge plugin window, redraw does not size/render viewport correctly, or [speculation] does not respond to the latest event.
This means one or more of:

  1. When making the window bigger, Surge is rendered smaller than the window, with a black border to the right/bottom.
  2. When making the window smaller, Surge is rendered bigger than the window, with scrollbars.
  3. When opening a Surge instance, or maximizing, the render viewport may be too small and clip the canvas.

This happens with or without display scaling (200%, 100%) on Windows.

Selecting Zoom > 100% works fine.
Zoom > 125% has scrollbars and a black margin where Surge is clipped to the right, after multiple resize events.
Zoom > 200% shows all of Surge, without scrollbars, with narrow black margins to the right and bottom about half the width of a scrollbar.

Surge Version
Version: Surge XT 0.9.nightly.1e11513
Build: 2021-09-30 @ 13:46:18 on 'fv-az165-140/pipeline' with 'MSVC-19.16.27045.0' using JUCE 60101
System: Windows 64-bit VST3 on Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Host: Cakewalk by Bandlab

Reproduction Steps:
Open a new Surge instance, or resize an open Surge window.

Expected Behavior:
Surge scales the canvas to suit the resized window, without: scrollbars, clipping, or margins to more than one edge.

Screenshots:
If applicable, add screenshots/GIF/videos to help explain your problem.

Computer Information (please complete the following information):

Additional Information:
Attached images show the result of a mouse resize.
While resizing, scrollbars pop in and out of existence and likely cause extra resize events.

Surge resize - no VK - BL-to-TR resize
Surge resize - drag bigger
Surge resize - clip

@j5v j5v added the Bug Report Item submitted using the Bug Report template label Oct 6, 2021
@mkruselj mkruselj added Host Specific Issues related to specific host(s) or host features UI Issues related to UI look&feel labels Oct 6, 2021
@VincyZed
Copy link
Collaborator

I also see a black border on the right and bottom in FL Studio:

image

@mkruselj mkruselj added this to the Surge XT 1.0 milestone Nov 29, 2021
@mkruselj mkruselj added Rebuild With JUCE Issues pertaining to porting Surge from VSTGUI to JUCE and removed Host Specific Issues related to specific host(s) or host features labels Nov 29, 2021
@mkruselj
Copy link
Collaborator

@baconpaul I reckon we need to use ResizableWindow::ComponentBoundsConstrainer here to make the resize actions have a fixed aspect ratio.

@baconpaul
Copy link
Collaborator

yeah i thought about that and looked at the code but there was some reason it didn't work. lets keep this open and see if we can.

@baconpaul
Copy link
Collaborator

so i played with these APIs some this morning and couldn't get them to work. Harumph. Not sure about this one.

@baconpaul
Copy link
Collaborator

i think i'm just going to have to install cakewalk on my windows box to understand this bug. Sigh.

@mkruselj mkruselj added the Might Bounce Out Of Milestone Issues we think might not make it for official release, coming from the milestone we're working on label Dec 14, 2021
@mkruselj mkruselj modified the milestones: Surge XT 1.0, Surge XT 1.1 Dec 19, 2021
@mkruselj mkruselj removed the Might Bounce Out Of Milestone Issues we think might not make it for official release, coming from the milestone we're working on label Jan 4, 2022
baconpaul added a commit to baconpaul/surge that referenced this issue Apr 2, 2022
This change correctly sets the aspect ratio constrainer for the
juce resize handler.

In standalone it perfectly preserves it
In bitwig mac vst3 it perfectly preserves it
In reaper mac the window is embedded and does not obey the content
aspect ratio
In logic there is no drag to resize

So seems it at least makes it 'better or same'. We should test this
in the daws showing problems in surge-synthesizer#5211 (which I dont have access to
right now) to see if it helps.
@baconpaul
Copy link
Collaborator

@mkruselj I wonder if the above, which improves the situation on mac, would also help windows so we could close this issue?

baconpaul added a commit that referenced this issue Apr 2, 2022
This change correctly sets the aspect ratio constrainer for the
juce resize handler.

In standalone it perfectly preserves it
In bitwig mac vst3 it perfectly preserves it
In reaper mac the window is embedded and does not obey the content
aspect ratio
In logic there is no drag to resize

So seems it at least makes it 'better or same'. We should test this
in the daws showing problems in #5211 (which I dont have access to
right now) to see if it helps.
@mkruselj
Copy link
Collaborator

mkruselj commented Apr 2, 2022

Standalone - works perfectly
Reaper - constrains to aspect ratio but Reaper's window can still be extended beyond aspect ratio. Thankfully not in a way that obstructs the actual GUI (until you get to very tiny zoom levels)
Studio One - works perfectly
FL Studio - works perfectly
Live 11 - works perfectly
Bitwig 4 - works perfectly

I have a couple other VST2 only hosts (MuLAB, Reason 11 and Maschine) but we don't have drag-to-resize in VST2 (is there a way to quickly enable it just to test?)

I don't have Cakewalk so I will leave that to @j5v to test when he can get around to it. But we are looking pretty good! That said, Valhalla plugins are JUCE too, and they don't have that resizing issue in Reaper, they resize constraining Reaper's window as well. Maybe you could ping schwa on CLAP board and ask what's up about that? 🙂

@j5v
Copy link
Contributor Author

j5v commented Apr 2, 2022

Cakewalk behaviour is now not problematic. I haven't seen the 'missing resize events' problem for a few months, but my usage has been light.

When resizing a Surge instance in Cakewalk, I momentarily see old-style region invalidation (white background) when resizing, so it looks like there's more than one effective repaint while different APIs resolve the resize events. I suspect the earlier problem was due to one of these APIs not acting as expected in the stack.

[observation, perhaps not related to Surge] for magnification of less than 100%, aspect ratios outside the range 5:2 and 5:6, Cakewalk shrinks the content to fit the window without cropping. For other ratios, it expands the content to fill one dimension and crop the other.

@mkruselj
Copy link
Collaborator

mkruselj commented Apr 2, 2022

@j5v So in short, situations like what you showcased in screenshots in opening post are not happening anymore in Cakewalk?

@baconpaul
Copy link
Collaborator

Vst2 does t have a host resize api so it really is just turn on the juce corner widget which generates the same events as our resize. If you want to do hat set the second argument of setresizable to true in surge synth editor but it will paint a corner booger over surge.

I’ll see if. Can figure out what Valhalla does differently yeah. But it seems like the change is the right change and this is fixed?

@mkruselj
Copy link
Collaborator

mkruselj commented Apr 2, 2022

Yeah, Valhalla gets the corner booger too in VST2. So I guess that's our answer.

@mkruselj
Copy link
Collaborator

mkruselj commented Apr 2, 2022

That said, I suppose we could override the paint method of ResizableBorderComponent?

@baconpaul
Copy link
Collaborator

We have a zoom menu and keybindings. VST3 CLAP and LV2 support host drag. I don't think we want the component.

I'm going to close this I think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Item submitted using the Bug Report template Rebuild With JUCE Issues pertaining to porting Surge from VSTGUI to JUCE UI Issues related to UI look&feel
Projects
None yet
Development

No branches or pull requests

4 participants