hyprland-community / pyprland

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

[FEAT] Multiple windows support for scratchpads #87

Closed Asthestarsfalll closed 4 months ago

Asthestarsfalll commented 4 months ago

Some applications have a launch or login window and then it will invocate a new runing window and destroy itself. This will cause pyprland to miss the new window. So can we add a existed window to a scratchpad? The config can be

[scratchpads.tmp]
command = ""
size = "70% 60%"

Use empty command to mark the scratchpad will take any exited windows.

For the first time, the pyprland toggle tmp will add the avtivate window to scratchpad tmp, and hide it. Then the behavior will be as same as normal command util the window are killed.

fdev31 commented 4 months ago

Is there remaining issues or can I close this ticket?

Asthestarsfalll commented 4 months ago

There is still another problem. I update Hyprland to 0.4.0.

I believe this is a bug of Hyprland. If you are using verison of 0.39.0, you may reproduce it by the following procedure:

  1. Open a special workspace and open a app, get the address of it.
  2. Open a terminal in this sepcial workspace, use hyprctl dispatch focuswindow address:.......

Then you will see the special workspace "close", and lost your focus. But in fact it just hide, if you toggle this speical workspace again, it will truly close.

This bug is fixed, but toggling scratchpads in s special workspace still reproduce this.

fdev31 commented 4 months ago

Reproduces this ? The only issue I see now is the blinking of the special workspace (which I don't think I can fix, looks like in Hyprland):

[DEBUG] scratchpads :: run_toggle('term',) :: command.py:188
[DEBUG] scratchpads :: visibility_check: ('1', 'DP-1') == ('1', 'DP-1') :: __init__.py:448
[DEBUG] scratchpads :: term visibility: False and False :: __init__.py:475
[INFO] scratchpads :: Showing term :: __init__.py:566
[DEBUG] scratchpads :: monitors :: ipc.py:84
[DEBUG] scratchpads :: dispatch resizewindowpixel exact 1920 864,address:0x63d7a25c9f00 :: ipc.py:126
[DEBUG] scratchpads :: clients :: ipc.py:84
[DEBUG] scratchpads :: dispatch ['moveworkspacetomonitor special:scratch_term DP-1', 'movetoworkspacesilent special:stash,address:0x63d7a25c9f00', 'alterzorder top,address:0x63d7a25c9f00'] :: ipc.py:126
[DEBUG] pyprland :: event_activewindowv2('63d7a2930080',) :: command.py:188
[DEBUG] pyprland :: active_window = 0x63d7a2930080 :: pyprland.py:60
[DEBUG] layout_center :: event_activewindowv2('63d7a2930080',) :: command.py:188
[DEBUG] scratchpads :: dispatch movewindowpixel exact 1520 60,address:0x63d7a25c9f00 :: ipc.py:126
[DEBUG] scratchpads :: dispatch focuswindow address:0x63d7a25c9f00 :: ipc.py:126
[DEBUG] pyprland :: event_activewindowv2('63d7a267c110',) :: command.py:188
[DEBUG] pyprland :: active_window = 0x63d7a267c110 :: pyprland.py:60
[DEBUG] layout_center :: event_activewindowv2('63d7a267c110',) :: command.py:188
[DEBUG] pyprland :: event_activewindowv2('63d7a25c9f00',) :: command.py:188
[DEBUG] pyprland :: active_window = 0x63d7a25c9f00 :: pyprland.py:60
[DEBUG] layout_center :: event_activewindowv2('63d7a25c9f00',) :: command.py:188

In this sequence, the only "ipc command" that I can imagine could trigger an animation is the "moveworkspacetomonitor" and even removing it I get the unexpected animation. Is it the problem you are referring to?

EDIT: link added: https://github.com/hyprwm/Hyprland/issues/5430

Asthestarsfalll commented 4 months ago

At first I think the blinking is due to focusing a window in the same special workspace. But latest Hyprland fixs this, the blinking still remainds. And I found this

fdev31 commented 4 months ago

Ok, but then you confirm there is no remaining issue to fix in Pyprland, just wait for a fix in Hyprland isn't it? I would really like to close this long ticket ^^

Asthestarsfalll commented 4 months ago

Ok, but then you confirm there is no remaining issue to fix in Pyprland, just wait for a fix in Hyprland isn't it? I would really like to close this long ticket ^^

yes, thanks for your helps!

fdev31 commented 4 months ago

Thank you for the report & testing. If there are some sub-optimal things you are welcome to open a new ticket, but until then It looks like those deffects we see are related to Hyprland instance.