YaLTeR / niri

A scrollable-tiling Wayland compositor.
https://matrix.to/#/#niri:matrix.org
GNU General Public License v3.0
4.12k stars 123 forks source link

Add `focus-window-previous` action #811

Closed zeroeightysix closed 1 day ago

zeroeightysix commented 5 days ago

This action focuses the previously focused window. As a parallel to focus-workspace-previous, this works across outputs, or within the same workspace, and should come in handy for users that have scripts making use of focus-window.

zeroeightysix commented 2 days ago

Been using this for a few days now without issue, so it's ready for a final review :)

YaLTeR commented 2 days ago

Yeah, sorry, I have this checked out, but I've been very busy with uni.

YaLTeR commented 1 day ago

Did some minor cleanups

YaLTeR commented 1 day ago

Hmm, what if we store the previous focused window just in the Niri state itself, rather than on each window? I think that should be simpler and should fix the layer-shell edge cases. I'll try doing it tomorrow when my brain is a bit clearer

YaLTeR commented 1 day ago

Could you please try this branch again? I made the change above.

zeroeightysix commented 1 day ago

Could you please try this branch again? I made the change above.

Will do. This approach also does look nicer.

zeroeightysix commented 1 day ago

Appears to be working as intended!

YaLTeR commented 1 day ago

Thanks!