WIP: apprt/gtk: fix equalizing when doubleclicking near the divider #4443
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.
This PR aims to fix #4354 .
Before
Screencast.From.2025-01-03.07-30-23.mp4
After
Screencast.From.2025-01-03.07-31-07.mp4
As you can see in the fix, one problem is that sometimes the resizing is bounced back to the original sizing (I didn't show it here, but this happens prior to this fix as well). My suspicion is with the race condition of doubleclick to equalize (this PR) and with the dragging of the divider to resize the panes. However, the latter might be a GTK feature we just use (?) as I couldn't find it anywhere in the codebase...
Apart from that, the function
equalizeTopSplit
I added in this fix, which climbs up the split parents to the topmost one, seems to partially function similarly toequalizeSplits
insideapprt/gtk/App.zig
(in the app we can just get the topmost split, while here we have to climb up as the Splits only have the knowledge of its parent). I want to prevent code repetition, so some advice here will also be nice as well.