-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make feature flags for the "focused" and launcher "modules" #404
Conversation
Thanks for the PR. As it is, the build is failing as you need to ensure code is formatted with There are also places that still need the feature flag (such as the Please also ensure you are using conventional commits. For example, Let me know if you need a hand squashing/amending your existing commits. Before this is merged, the docs will also need to be updated to include the new flags at a minimum. Let me know whether you're happy to take that on, and if not I can do that. |
I'm sorry for the trouble if that's the case. This is my first time contributing to someone else's repository, and I'm not quite experienced with git. This time I tested the changes with more combinations of the build flags to make extra sure it would compile, but there are still some warnings I haven't managed to fix. These warnings only show up when compiling without the focused and launcher features though. When compiling with default features I get no new errors |
Do you feel there's a need to add some note to the build documentation on what wayland protocols are needed to enable the |
No need to apologise. Git is a tricky beast, and this is fairly complex low level stuff. The only way to learn these things is to get in the weeds and try and find your way out, so I'm more than happy to lend a helping hand.
I think a little alert of the appropriate kind at the top of each applicable module page would be best. Just to say "this module requires a wlroots compositor" or something akin to that. Thanks for updating - there's a few more bits I've noticed after reviewing if you can have a look at those please. I'll try and do a deeper dive this evening and compile for myself just to verify too. Once that's all clear, we can have a look at squashing down the commits. |
I got the changes implemented now. I added notes in the docs as well, and for the sake of consistency, I put a note on the clipboard module to tell the user it requires the wlr-data-control protocol for to work. I don't think the other modules need notes as they only rely on standardized protocols |
I think that conflict has just been introduced by me merging in other PRs - let me know if you need my help resolving that. Otherwise, code lgtm now so thanks for that. The note in the docs I think should clearly say you require a wlroots-based compositor like I had above. It's fine specifying the required protocol in there, but most people won't know much about the underlying protocols and will know if they're on a wlroots compositor. Then lastly, if you can squash the commits down please. I think a single commit is best now, since both feature flags are kinda tied together:
Once that's done, I reckon we should be just about there. |
I think that's all changes implemented. Please review it, and tell me if there's annything that needs to be changed. Also I created another PR by accident, and I'm not sure if there's a way to delete it rather than just closing. I thought that using github's interface to sync the changes would be a good idea, but I was a fooled. Different from using the terminal, on the web interface it's hard to tell which changes are applied to remote before I can review them. |
Just having a look at the build results, and there are a lot of unused code warnings for code in various places when you run with
If you can amend the commit to resolve those, and the related pattern matches, then I think that should be good enough. |
I don't think there is, but don't worry about it. It's easy to muck it up, especially when you're using a GUI and you're not sure what it's doing under the hood. |
I tried putting those two variant constructors under either the |
I think you're making things more complex than they need to be. I missed this when I reviewed because of the way GitHub shows only diffs (at least that's my excuse...) but when it comes to the So for example, you currently have: Msg(Request::ToplevelFocus(id)) => {
#[cfg(any(feature = "focused", feature = "launcher"))]
let handle = env
.handles
.iter()
.find(|handle| handle.info().map_or(false, |info| info.id == id));
#[cfg(not(any(feature = "focused", feature = "launcher")))]
let handle: Option<()> = None;
#[cfg(any(feature = "focused", feature = "launcher"))]
if let Some(handle) = handle {
let seat = env.default_seat();
handle.focus(&seat);
}
send!(env.response_tx, Response::Ok);
} Instead, you only need (and want) one feature flag, so that the whole (In this case too, So this can become just: #[cfg(any(feature = "launcher"))]
Msg(Request::ToplevelFocus(id)) => {
let handle = env
.handles
.iter()
.find(|handle| handle.info().map_or(false, |info| info.id == id));
let handle: Option<()> = None;
if let Some(handle) = handle {
let seat = env.default_seat();
handle.focus(&seat);
}
send!(env.response_tx, Response::Ok);
} |
Ok, got it. With this implemented there are considerably fewer warnings than before. Though there's one still pestering me quite a bit, which is this one:
I tried removing that line of code (I didn't push it), and it compiled just fine for all combinations of feature flags, so I was wondering what it's for |
Ah, that's a trick one just to confuse you. I added it during some refactoring last week, ended up not using it, then deleted it earlier today. You can ignore that one :) All lgtm now, thanks for all your work on this! |
Implementation to solve issue 403. Please tell me if there is something I should change or refactor.
Resolves #403.