hyprland-community / pyprland

Scratchpads & many goodies for Hyprland [maintainer=@fdev31]
MIT License
345 stars 15 forks source link

[IMPROVEMENT] Add support for pinned windows #112

Closed alexhulbert closed 2 months ago

alexhulbert commented 3 months ago

Pyprland version 2.3.8 (also experienced the bug on 2.3.6) Hyperland version 0.40

Describe the bug Scratchpad windows don't into a special workspace when hidden. They just stay in the workspace.

To Reproduce Steps to reproduce the behavior:

  1. Show and hide a scratchpad
  2. run hyprctl clients and observe that the window is still in the current workspace.

Expected behavior I expect based on reading the source code that the window should be put in a special workspace after its out of view. This would make it so it's not shown when I use the hycov plugin.

Configuration (provide following files/samples when relevant): pyprland.toml hyprland.conf

Additional context The issue happens for me with both PWAs and with my terminal. Other than that the software works perfectly though! Thanks so much for putting in all the effort to make it so stable!

fdev31 commented 3 months ago

I can not reproduce this, can you also send the pypr logs of a session where you try to toggle the scratchpad ? I assume the window then stays visible instead of hidding, do you confirm?

alexhulbert commented 3 months ago

Ah, I did a bit more digging and figured out that it's because I wrote a rule to pin the window. Even with the window pinned, pyprland works fine. The windows hide and show correctly. The only negative side effect is that they pop up in my window overview while I'm alt+tabbing through windows.

The issue is that when a window is pinned, you can't send it to another workspace. I really like having my sidebars pinned, because then you can switch workspaces and the sidebar comes with you. Back when I had my own janky sidebar plugin for i3, I would frequently use sidebars while flipping back and forth between to windows to reference different content. I'd love to have this functionality in pyprland. Would it be possible to pin the window when it's shown and unpin it before switching it to the special workspace? I don't think this would cause any problems. Thanks!

fdev31 commented 3 months ago

If the scratchpad unpins to hide and then recovers the pinned status on show it sounds quite right isn't it? I'll look at it, doesn't sound terrible to implement.

fdev31 commented 2 months ago

So it turned to not be as easy as I thought, it leads to many additional calls for this use case... Do you need to toggle the pinned window state or would a pypr config such as pinned=true do the job as well?

alexhulbert commented 2 months ago

Just setting pinned=true is good. I can't think of any reason why anyone would want to toggle it dynamically. Thanks so much for looking into it!

fdev31 commented 2 months ago

I'll have time again next week IMO, will keep you informed!

fdev31 commented 2 months ago

@alexhulbert I couldn't find a decent way to implement it with the current IPC API, if you see one please shout so I close the feature request I just opened to be able to implement this feature...

alexhulbert commented 2 months ago

Oh weird, thanks for making the issue!

fdev31 commented 2 months ago

So, apparently there is a way, I was probably tired yesterday when I looked at it...

Check the latest git if possible, pinned is the new default, do you think this is a good idea? You can disable it with pinned = false

alexhulbert commented 2 months ago

Works perfectly! Thanks so much! I think it would definitely make sense to make this the default.