surge-synthesizer/shortcircuit-xt

Update internal state before message send on select (was click-drag-borked)

Closed this issue · 8 comments

Make some empty zones. Click them one by one. Strange things happen

What

whoa that's bad. i wonder when that started. i'll look at this one as a priority.

The log message shows

src/engine/group.cpp:499 [20:52:18.424] Implement Group LFO modulator use optimization (Message will only appear once)
src/selection/selection_manager.cpp:357 [20:52:24.666] guaranteeSelectedLead Be careful - we are promoting leadZone[selectedPart]=zoneaddr[p=0,g=0,z=1] 
src/selection/selection_manager.cpp:357 [20:52:25.420] guaranteeSelectedLead Be careful - we are promoting leadZone[selectedPart]=zoneaddr[p=0,g=0,z=1] 

If I had to guess I would look hard at 0babc62

Note that it only started happening for me when i added a second group.

OK smallest possible repro is this

empty SC
create 2 zones - seems OK
adds a 3 zone - seems OK most of the time
add a group and click around - blows out almost immediately

so need to run this with the selection debugger to see if its a back end or up problem.

Will work on this as priority next.

Ahh this is an evil bug

what seems to be happening is the selection action is pushing the prior selected zone onto the new selected zones bounds

Screenshot 2024-09-05 at 9 17 09 PM

start here and click around some and the "zone disappears"
Screenshot 2024-09-05 at 9 17 24 PM

but it hasn't disappeared. What has happened is zone 2 and 3 are now co-incident.

so it's not the response its the outbound selection message getting screwed up somewhere.

Cool knowing that i should be able to find it tomorrow.

Oh ha no you know what it is

its the change to allow you to move when you click

we are generating a very small move when we select and its racing to the back end with the wrong selected zone

I can fix this tomorrow but it's just a micro-drag when you click moving something by zero at the same time you select it and sending the wrong zone as being updated to the server.

Yeah

void MappingDisplay::mappingChangedFromGUI()
{
    SCLOG("Mapping Changed from GUI");
    sendToSerialization(cmsg::UpdateLeadZoneMapping(mappingView));
}

that fires on a 'click to disappear'

will find this now i know that. but not tonight.

Nice hunting!

Yeah I have a temporary workaround (which is you have to drag at least 2 pixels from mouse down spot to start a move) which is going in now to make this less annoying immediately but I also know what the correct fix is (namely when you do a select you update the internal state before you send the message, basically - but that's trickier).