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 a floating layer #49

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Add a floating layer #49

merged 1 commit into from
Sep 2, 2024

Conversation

zakj
Copy link
Contributor

@zakj zakj commented Aug 31, 2024

Windows in the floating layer are tracked by their window id in is_floating, and persisted across restarts/reloads via hs.settings. The new toggle_floating action can be used to flip the focused window between floating and tiled state.

Would love any feedback here!

Fixes #24.

Copy link
Owner

@mogenson mogenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Let me try this out.

Do you have to send the floating window to front or send the tiled windows to back while dragging floating windows / switching tiled windows in order to keep the floating windows on top and visible?

init.lua Outdated Show resolved Hide resolved
init.lua Outdated Show resolved Hide resolved
init.lua Outdated Show resolved Hide resolved
init.lua Outdated Show resolved Hide resolved
init.lua Show resolved Hide resolved
@zakj
Copy link
Contributor Author

zakj commented Sep 2, 2024

Do you have to send the floating window to front or send the tiled windows to back while dragging floating windows / switching tiled windows in order to keep the floating windows on top and visible?

I am treating this like less of a discrete layer than a per-window-id ignore list, since that's primarily my use case. I tried bringing all of the floating windows to the front when focusing one of them, and it felt wrong to me.

One potential awkwardness with this approach is that adding a window to the floating list and then focusing a tiled window does not bring all the other tiled windows to the front; so you can end up with a mix of tiled windows above/behind floating windows. In practice so far this feels more macOS-like, but perhaps less PaperWM-like.

@mogenson
Copy link
Owner

mogenson commented Sep 2, 2024

Looks good to me! I haven't found any issues when using this for a bit. I don't think there's a good way to keep floating windows on top of tiled windows. hs.window:raise() can be buggy and steal focus (despite what the docs say). I think raising every floating window after any tiling action would be too chaotic.

Before I merge, could you please squash your commits into just one and also update the example keybindings in the README: https://github.com/mogenson/PaperWM.spoon?tab=readme-ov-file#usage

Windows in the floating layer are tracked by their window id in
`is_floating`, and persisted across restarts/reloads via hs.settings.
The new toggle_floating action can be used to flip the focused window
between floating and tiled state.

Fixes mogenson#24.
@zakj
Copy link
Contributor Author

zakj commented Sep 2, 2024

Done, thanks!

@mogenson mogenson merged commit 171bae1 into mogenson:main Sep 2, 2024
1 check passed
@zakj zakj deleted the floating-windows branch September 3, 2024 01:11
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.

Feature request: floating layer
2 participants