PaperWM.spoon icon indicating copy to clipboard operation
PaperWM.spoon copied to clipboard

Feature: Keep floating windows on the top

Open RGBCube opened this issue 6 months ago • 4 comments

Would it be possible to instruct MacOS to keep floating windows at the top, like in niri? Since they don't "tile", it's better to keep them directly visible and movable

Also, a way to make fixed width windows automatically float would be cool!

RGBCube avatar Jun 22 '25 20:06 RGBCube

Hello, I don't have any current plans to implement this feature. But, I'm happy to review a PR. I'll keep this issue open as a feature request.

mogenson avatar Nov 08 '25 19:11 mogenson

This might be better as its own issue, but I think a keyboard shortcut to bring all floating windows to the front could be just as useful, and might be easier to pull off.

leaferiksen avatar Dec 03 '25 20:12 leaferiksen

Let me know if either of you would like to prototype this feature.

I believe you would need to iterate over the floating windows and call raise() for each. Perhaps make sure they're not hidden or minimized first.

You could either do this everytime a space is tiled to automatically keep floating windows on top, or hook it into a key binding.

mogenson avatar Dec 03 '25 21:12 mogenson

@mogenson I'm not a very good programmer and I'm not familiar with lua outside of PaperWM's config file, but once I'm on christmas break I might take a look at it. Thanks for the guidance.

leaferiksen avatar Dec 05 '25 17:12 leaferiksen

raise() didn't quite work, because all windows were still hidden behind the active window, but focus() did the trick. I got some help understanding what to do from the gemini cli so a large portion of the function is vibe coded, but I made sure everything follows the guidelines for contributing, and I ran the formatter and the unit tests. Do y'all accept code made with ai, or should I keep this commit to myself?

leaferiksen avatar Jan 01 '26 19:01 leaferiksen

Hmm, any issues with raise() probably need to be addressed in the Hammerspoon repo.

Focusing a series of floating windows will definitely keep them on top of tiled windows. This approach might be better suited for a user-triggered keybinding instead of an automatic behavior.

I don't mind how you created code as long as you understand what it does and can ensure it works without adverse side effects. Feel free to submit a PR :)

mogenson avatar Jan 02 '26 01:01 mogenson