Handle unordered add / position change events#1555
Open
StefansM wants to merge 1 commit into
Open
Conversation
Fixes (some cases of) plugins ignoring saved `(x, y)` coordinates when a project is loaded. The canvas can get notified of a plugin's position before the plugin is actually added, so when the plugin is actually it just goes to the default position. This happens because `PatchbayClientPositionChanged` events can arrive before `PatchbayClientAdded` events, as seen in debug logs like this: ``` ... PatchCanvas::joinGroup(30) PatchCanvas::joinGroup(30) - unable to find groups to join PatchCanvas::setGroupPos(30, 1118, 591, 0, 0) PatchCanvas::setGroupPos(30, 1118, 591, 0, 0) - unable to find group to reposition PatchCanvas::addGroup(30, b'Audio to CV', SPLIT_UNDEF, ICON_PLUGIN) ... ``` If this happens, the canvas box will be placed in the default position, rather than obeying the `PatchbayClientPositionChanged` signal. This PR keeps track of missed events and then applies them once the object is actually added.
Contributor
Author
|
I'm sure that there is a better way to do this, but some quick googling suggests that QT doesn't guarantee the order in which slots get called, so state will need to be aggregated somewhere. |
Owner
|
is this happening using pipewire or jack? |
Contributor
Author
|
Apologies for the slow response. I've only observed this using Jack. I've not tried with any other backends though, so I can't draw any conclusions from that. |
edcab1c to
903ad4d
Compare
mxmilkiib
pushed a commit
to mxmilkiib/Carla
that referenced
this pull request
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes (some cases of) plugins ignoring saved
(x, y)coordinates when aproject is loaded. The canvas can get notified of a plugin's position
before the plugin is actually added, so when the plugin is actually it
just goes to the default position.
This happens because
PatchbayClientPositionChangedevents can arrivebefore
PatchbayClientAddedevents, as seen in debug logs like this:If this happens, the canvas box will be placed in the default position,
rather than obeying the
PatchbayClientPositionChangedsignal. This PRkeeps track of missed events and then applies them once the object is
actually added.