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 "Pin" Flag? #1

Closed
jjgmckenzie opened this issue Nov 22, 2023 · 8 comments
Closed

Add "Pin" Flag? #1

jjgmckenzie opened this issue Nov 22, 2023 · 8 comments
Assignees

Comments

@jjgmckenzie
Copy link

I prefer my PiP videos to be "pinned" between workspaces. This is a personal preference thing, and I have already edited it for my own use case locally.

Is there any interest in this being integrated upstream, potentially as a flag, ie

exec-once = pipfloat --pin
@jjgmckenzie jjgmckenzie changed the title Add "Pin" Flag Add "Pin" Flag? Nov 22, 2023
@morr0ne
Copy link
Owner

morr0ne commented Nov 23, 2023

Unfortunately I am not sure how to implement such a feature. I also prefer my videos to be pinned and I actually manually pin them each time. The reason It's not implemented is because, as far as I can tell, there is no way to pin a specific windows but only the focused one. I might be wrong here or relying on outdated information but if you know of a way to do it I'd be more than happy to implement it.

@jjgmckenzie
Copy link
Author

Yes, you are correct that you cannot specify which window to pin, only the active window. I have no specific workaround to that problem.

However, when a window is newly opened, it does become the active window; and so when I edited the code to dispatch TogglePin afterwards, that worked for me.

Of course, there may be unforeseen problems with this approach, so it may be worth requesting that hyprland-rs allows to specify a window for the ::TogglePin dispatch in the same way as ::ToggleFloating does

@morr0ne
Copy link
Owner

morr0ne commented Nov 23, 2023

However, when a window is newly opened, it does become the active window; and so when I edited the code to dispatch TogglePin afterwards, that worked for me.

At first I tried the same thing but after some testing it proved unreliable, I am not sure if its a bug or intended behavior but the active window can change between dispatches

Of course, there may be unforeseen problems with this approach, so it may be worth requesting that hyprland-rs allows to specify a window for the ::TogglePin dispatch in the same way as ::ToggleFloating does

Unfortunately its not a limitation of hyprland-rs but a limitation of hyprland socket itself. As far as I'm aware hyprland does not expose such functionality

Yes, you are correct that you cannot specify which window to pin, only the active window. I have no specific workaround to that problem.

While writing this issue I actually realized a potential workaround, if we force the pip window to be active right before we send the pin dispatch, it might avoid any inconsistencies

@jjgmckenzie
Copy link
Author

Unfortunately its not a limitation of hyprland-rs but a limitation of hyprland socket itself. As far as I'm aware hyprland does not expose such functionality

According to this documentation, it does. Unsure if that is new functionality, which would explain why hyperland-rs does not extend that?

https://wiki.hyprland.org/Configuring/Dispatchers/

@morr0ne
Copy link
Owner

morr0ne commented Nov 23, 2023

According to this documentation, it does. Unsure if that is new functionality, which would explain why hyperland-rs does not extend that?

I am pretty sure its new functionality or at least it wasn't there when I needed it. I'll open a pr on hyprland-rs but that might have to wait a bit since I realized that that project is not licensed properly.

@jjgmckenzie
Copy link
Author

I've left an issue on that repo at hyprland-community/hyprland-rs#146

Thanks for your help figuring out the root cause

@morr0ne
Copy link
Owner

morr0ne commented Nov 23, 2023

Thanks for that. As soon as that is implemented it should be trivial to update this repo

@morr0ne
Copy link
Owner

morr0ne commented Nov 24, 2023

Starting with release 0.2.0 windows now get properly pinned. As usual you can compile it yourself or download the latest release. Thanks for making me aware this was possible.

@morr0ne morr0ne closed this as completed Nov 24, 2023
@morr0ne morr0ne self-assigned this Nov 24, 2023
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

No branches or pull requests

2 participants