Skip to content

Fix connections not drawn when second port arrives after connection registered - #28

Open
ycollet wants to merge 1 commit into
Houston4444:mainfrom
ycollet:ycollette/fix_redraw
Open

Fix connections not drawn when second port arrives after connection registered#28
ycollet wants to merge 1 commit into
Houston4444:mainfrom
ycollet:ycollette/fix_redraw

Conversation

@ycollet

@ycollet ycollet commented Jun 24, 2026

Copy link
Copy Markdown

When add_connection() fires before one port is in the canvas, the connection is stored as hidden on both ports.
When the late port is finally added to the canvas, visible_conns were correctly cleared from the hidden sets but conn.add_to_canvas() was never called, leaving the line undrawn until a manual canvas refresh.

Tested on Fedora 44.

…egistered

When add_connection() fires before one port is in the canvas, the connection
is stored as hidden on both ports. When the late port is finally added to
the canvas, visible_conns were correctly cleared from the hidden sets but
conn.add_to_canvas() was never called, leaving the line undrawn until a
manual canvas refresh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Houston4444

Copy link
Copy Markdown
Owner

Hi. Sorry for the late answer. I must say no, this is not a correct way to fix your problem, I really don't want that the method add_to_canvas (available on connection, group, port, portgroup) calls add_to_canvas for other elements, I think it could break algorithms where it is used. There is certainly a nicer way to fix your problem. However, the strange thing here is:

When add_connection() fires before one port is in the canvas

why does a such inconsistent thing happens ???
I think that when it happens the logic would be that the connection is simply ignored (not hidden).

@ycollet

ycollet commented Jun 28, 2026

Copy link
Copy Markdown
Author

OK for me. We can abandon this PR. The problem was: from time to time, I need to do a refresh because no connexions shows up, but the refresh step redraw them. So, there is a redraw problem somewhere :)
The problem occurs only from time to time (1 time out of 10). Do you want me to open a ticket instead ?

@Houston4444

Copy link
Copy Markdown
Owner

mmmh, yes why not. However it is interesting for me to understand what can happen. Are you sure (or pretty sure) that the problem happens when connection is added before the port ? If it is the case, there is a problem somewhere before (in RaySession, it could come from a problem of order of OSC messages between the patchbay daemon and the GUI, but I never met this problem, a problem with PipeWire directly or with python JACK module).

Not easy to catch it, it would be interesting to make a script that creates the problem regularly when raysession is started with some logs with raysession --dbg patch_engine:patchbay (you will have the order of messages received from JACK and theses ones received by HoustonPachbay, see if it is consistent).

@ycollet

ycollet commented Jun 28, 2026

Copy link
Copy Markdown
Author

OK, I leave this open util I've got a dbg log. Then I will close the PR and open a ticket with all the information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants