-
Notifications
You must be signed in to change notification settings - Fork 179
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
add keybindings: prev_output, prev_output_with_win #2072
Conversation
Haven't noticed there's already #1570. I may take up his work then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in the other PR (#1570) there are two changes needed:
- The get_prev_output() shouldn't be added to core at all, oswitch can do that on its own.
- It would be nice to refactor the code so that the functions for next and previous output reuse the same code. Currently, they do the exact same thing but with the only difference of previous/next output. I imagine it should be easy to refactor them to use a common function
switch_to_output(target_output)
andswitch_to_output_with_window(target_output)
a23f5cc
to
52b4aef
Compare
I did some refactor to the original functions, most importantly add I haven't implement |
That is fine, since you are doing the work, you can only add whatever you find useful :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, thanks!
Please fix code style as well (there is a diff in the CI logs) |
This commit makes get_output_relative get the target output n steps after current output (instead of a given output), in order to reduce duplicated funciton calls in activator callbacks.
I've fixed the code style with your fork of uncrustify, hopefully it can pass! |
* refactor oswitch functions * change the logic of get_output_relative This commit makes get_output_relative get the target output n steps after current output (instead of a given output), in order to reduce duplicated funciton calls in activator callbacks.
provide an api
wf::output_t *get_prev_output(wf::output_t *output)
in core/output-layout.hppand use this api to implement
prev_output
andprev_output_with_win
fixes #2071