Skip to content
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 focus-window-previous action #811

Merged
merged 3 commits into from
Nov 21, 2024
Merged

Add focus-window-previous action #811

merged 3 commits into from
Nov 21, 2024

Conversation

zeroeightysix
Copy link
Contributor

@zeroeightysix zeroeightysix commented Nov 16, 2024

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.

  • what should happen when the previously focused window has since been closed?
  • todo: test this as daily driver and on a multi-monitor setup

src/input/mod.rs Outdated Show resolved Hide resolved
src/input/mod.rs Outdated Show resolved Hide resolved
src/niri.rs Outdated Show resolved Hide resolved
src/niri.rs Outdated Show resolved Hide resolved
src/niri.rs Outdated Show resolved Hide resolved
src/niri.rs Outdated Show resolved Hide resolved
@zeroeightysix
Copy link
Contributor Author

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

@YaLTeR
Copy link
Owner

YaLTeR commented Nov 20, 2024

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

@YaLTeR
Copy link
Owner

YaLTeR commented Nov 20, 2024

Did some minor cleanups

@YaLTeR
Copy link
Owner

YaLTeR commented Nov 20, 2024

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
Copy link
Owner

YaLTeR commented Nov 21, 2024

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

@zeroeightysix
Copy link
Contributor Author

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

Will do. This approach also does look nicer.

@zeroeightysix
Copy link
Contributor Author

Appears to be working as intended!

@YaLTeR YaLTeR merged commit a74a578 into YaLTeR:main Nov 21, 2024
10 checks passed
@YaLTeR
Copy link
Owner

YaLTeR commented Nov 21, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants