refactor(floating_panes): updating tile-pane and float-pane to use new layout mechanics.#5188
Open
daneofmanythings wants to merge 2 commits into
Open
Conversation
696cc30 to
5d81c9e
Compare
Member
Author
|
Okay, I believe I have gotten it to a testable point. Things I am unsure about:
|
Member
|
@mgrant0 should look at this preferably :-). |
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.
(WIP)I am updating
tile-paneandfloat-paneto use the new layout logic system. Once this is solid, I will be moving the functionality into the other existing commands.I will detail here how I plan on accomplishing this
(bugs are still being squashed). Note that function names can be changed; they were made hastily to get coding.Given that we would like to be able to restore floating layout geometry, some new state needs to be added to
struct layout_cellto track this. It was previously added tostruct window_pane. I am not certain adding four new fields is the correct approach, but it is the simplest for now.When a tiled pane is "floated":
splitw; splitw -h; floatp -t2; floatp -t1). This is currently being done inlayout_cell_remove_tile.layout_cell_floating_args.When a floating pane is "tiled":
layout_cell_get_neighbour(a neighbour is a sibling that exists in the tiled layout). Since floating panes now have meaningful layout positions, this will restore the pane to its previous position.layout_split_paneto reuse logic) in place and recursively resize siblings/parents as necessary to make room. This is happening inlayout_cell_insert_tile. None of the old tiled dimensions are stored nor used for this calculation. There is no guarantee of consistent layout state between floating and tiling, so the simplest thing to do is a 50/50 split of the parents type. Logic can be added in the future to track IF the state hasn't changed, the old tiling dimensions can be used.A lot of the PR so far is pulling out existing logic into their own functions for reuse with two new workhorse functions
layout_cell_remove_tileandlayout_cell_insert_tile. I am anticipating using these in the logic to hide/show panes, which is why they aren't local to the tile/float commands.Let me know if ya'll have any thoughts or questions on what I have here.
The code is still being debugged, so is less useful to look at, but don't hesitate to provide feedback anyway.Thanks!@nicm @mgrant0