Add Sway support as separate feature #138
Open
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 an alternate approach to supporting Sway, competing with the PR #122
Old Approach -- Shared Feature
In #122, both Sway and i3 were supported as the the same compile-time feature. This was done by switching from an i3-specific library to "swayipc", which supports both window managers.
This maximized shared code, but in practice was difficult to get merged because the Sway developer didn't test on i3, where it turned to break support. But the i3 developer didn't have Sway installed. The situation meant that in practice it was hard to make changes to support either WM without a risk of breaking the other.
New Approach -- Seperate Feature
In the new approach, the i3 code is not really touched at all, and should therefore continue to work just as it did before.
Sway is implemented as a separate feature. Now code for either WM can be updated without a risk of breaking the other.
One challenge with the new approach is each is implemented as a compile-time feature.
Packagers who need to support both window-managers will need to publish two packages, like
wmfocus-i3
,wmfocus-sway
. Depending on which is selected, the installedwmfocus
will work with one or the the other.I'm a beginning Rust developer and don't expect to be able to support them both at a runtime with this approach, but maybe someone can build on what I've done to make that work.
Both approaches draw the windows with X11 not Wayland. Having the Sway feature draw the the windows with Wayland is another feature which could be added down the road.