tudurom / windowchef

Window Chef is a stacking window manager that cooks windows with orders from the Waitron
https://tudorr.ro/software/windowchef/
ISC License
203 stars 14 forks source link

Directionalfocus #27

Closed allora closed 7 years ago

allora commented 7 years ago

This adds support for cardinal window focusing. Users are able to pick a window to focus based on the closest window within the desired cardinal direction.

For example a user sending the command: waitron window_cardinal_focus up will change the focused window to the one above the current window, if one exists and there is a current focused window. Testing on a triple head setup showed that the algorithm for window focus selection worked as expected across displays.

I've attempted to have "good defaults" for the window selection heuristics, but arguably they could be made into config settings instead, with a default in the config.h file.

I also added a group_remove_all_windows, which does what it sounds like it does. Removes all windows from a group.

tudurom commented 7 years ago

Wow, I am truly impressed. Thank you for the huge contribution. But there's a problem that isn't letting me merge the pr: you used a different code style. Please adapt your changes to the code style (opening brace on the same line as the statement, no C++ style comments etc.).

allora commented 7 years ago

Sorry about that, work habits :) Updated.

tudurom commented 7 years ago

Also, the group_remove_all_windows command removes all the windows from all the groups because there is no check. Your code iterates over all windows and removes the group.

allora commented 7 years ago

Updated. This is a total brain fart on my end O_o. In testing it, I don't think it was ever tested with multiple groups assigned haha.

tudurom commented 7 years ago

Thanks! I will add you to the "thanks to" section in the readme ;)

allora commented 7 years ago

Awesome! Thanks :)