Giter Site home page Giter Site logo

Comments (6)

dantefromhell avatar dantefromhell commented on June 1, 2024 1

Ok, I suspect this is a case like emacs client, where the windows aren't matching the process pid...

🎉 Thanks so much, this was the issue indeed.
Anytype is electron based and the PID reported by hyprctl clients is a sub process/ thread of the PID logged by pyprland.

IMO it would be helpful if the class parameter was documented in the scratchpads wiki section.

From my side this issue can be marked resolved as the original question is resolved, I haven't re-tested the python stacktrace issues reported above though.

from pyprland.

dantefromhell avatar dantefromhell commented on June 1, 2024

The same configuration, but using wezterm as the command works as expected and produces the following log files

pypr.log

2023-09-02 16:59:35,472 [DEBUG] pypr :: CMD: run_toggle(['term']) :: command.py:119
2023-09-02 16:59:35,472 [DEBUG] pypr :: scratchpads.run_toggle('term',) :: command.py:73
2023-09-02 16:59:35,472 [DEBUG] scratchpads :: term is visible = False :: scratchpads.py:262
2023-09-02 16:59:35,473 [DEBUG] ipc :: activewindow :: ipc.py:25
2023-09-02 16:59:35,473 [INFO] scratchpads :: Showing term :: scratchpads.py:358
2023-09-02 16:59:35,473 [INFO] scratchpads :: term is not running, restarting... :: scratchpads.py:361
2023-09-02 16:59:35,957 [DEBUG] pypr :: scratchpads.event_activewindowv2('45c7840\n',) :: command.py:73
2023-09-02 16:59:35,957 [DEBUG] pypr :: scratchpads.event_openwindow('4605140,special,wezterm-scratchpad,wezterm\n',) :: command.py:73
2023-09-02 16:59:35,957 [DEBUG] ipc :: clients :: ipc.py:25
2023-09-02 16:59:35,980 [DEBUG] ipc :: monitors :: ipc.py:25
2023-09-02 16:59:35,982 [DEBUG] ipc :: clients :: ipc.py:25
2023-09-02 16:59:35,983 [DEBUG] ipc :: moveworkspacetomonitor special:scratch_term eDP-1 :: ipc.py:53
2023-09-02 16:59:35,984 [DEBUG] ipc :: movetoworkspacesilent 1,address:0x4605140 :: ipc.py:53
2023-09-02 16:59:35,985 [DEBUG] pypr :: scratchpads.event_activewindowv2('459e530\n',) :: command.py:73
2023-09-02 16:59:35,986 [DEBUG] ipc :: movewindowpixel exact 1074 2220,address:0x4605140 :: ipc.py:53
2023-09-02 16:59:35,986 [DEBUG] ipc :: focuswindow address:0x4605140 :: ipc.py:53
2023-09-02 16:59:35,987 [DEBUG] pypr :: scratchpads.event_activewindowv2('4605140\n',) :: command.py:73

hyprland.log

[LOG] [16:59:35:330] Keybind triggered, calling dispatcher (64, , 104)
[LOG] [16:59:35:330] Executing WAYLAND_DISPLAY=wayland-1 DISPLAY=:0 pypr toggle term
[LOG] [16:59:35:339] Process Created with pid 18200
[LOG] [16:59:35:833] New TextInput added!
[LOG] [16:59:35:834] Registered signal for owner 45efb30: 45a0c58 -> 45efb48 (owner: textInput)
[LOG] [16:59:35:834] Registered signal for owner 45efb30: 45a0c68 -> 45efc18 (owner: textInput)
[LOG] [16:59:35:834] Registered signal for owner 45efb30: 45a0c78 -> 45efbb0 (owner: textInput)
[LOG] [16:59:35:834] Registered signal for owner 45efb30: 45a0c88 -> 45efc80 (owner: textInput)
[LOG] [16:59:35:875] New XDG Surface created. (class: (null))
[LOG] [16:59:35:875] Registered signal for owner 4605140: 4604fe0 -> 46051a8 (owner: XDG Window)
[LOG] [16:59:35:875] Registered signal for owner 4605140: 45eb890 -> 4605278 (owner: XDG Window)
[LOG] [16:59:35:955] Registered signal for owner 4605140: 45a95e0 -> 4605758 (owner: Toplevel)
[LOG] [16:59:35:955] Registered signal for owner 4605140: 45a95f0 -> 46057c0 (owner: Toplevel)
[LOG] [16:59:35:955] Registered signal for owner 4605140: 45a9600 -> 46056f0 (owner: Toplevel)
[LOG] [16:59:35:955] Registered signal for owner 4605960: 4605010 -> 4605968 (owner: CWLSurface)
[LOG] [16:59:35:955] CWLSurface 4605960 called init()
[LOG] [16:59:35:955] Registered signal for owner 4605140: 4604ff0 -> 4605210 (owner: CWindow)
[LOG] [16:59:35:955] Searching for matching rules for wezterm-scratchpad (title: wezterm)
[LOG] [16:59:35:955] Window rule size 75% 60% -> ^(wezterm-scratchpad)$ matched 4605140 [wezterm]
[LOG] [16:59:35:955] Window rule float -> ^(wezterm-scratchpad)$ matched 4605140 [wezterm]
[LOG] [16:59:35:955] Window rule workspace special silent -> ^(wezterm-scratchpad)$ matched 4605140 [wezterm]
[LOG] [16:59:35:956] Rule workspace matched by window 4605140, ^(wezterm-scratchpad)$ applied.
[LOG] [16:59:35:956] Rule size, applying to window 4605140
[LOG] [16:59:35:956] Window got assigned a surfaceTreeNode 0
[LOG] [16:59:35:956] Registered signal for owner 4605140: 4604fd0 -> 4605140 (owner: XDG Window Late)
[LOG] [16:59:35:956] Registered signal for owner 4605140: 45eb050 -> 46052e0 (owner: XDG Window Late)
[LOG] [16:59:35:956] Registered signal for owner 4605140: 45eb8b0 -> 4605418 (owner: XDG Window Late)
[LOG] [16:59:35:956] Registered signal for owner 4605140: 45eafe0 -> 4605550 (owner: XDG Window Late)
[LOG] [16:59:35:956] Registered signal for owner 4605140: 45eb000 -> 46054e8 (owner: XDG Window Late)
[LOG] [16:59:35:956] Registered signal for owner 4605140: 45eb010 -> 4605480 (owner: XDG Window Late)
[LOG] [16:59:35:956] Registered signal for owner 4605140: 45eb020 -> 46055b8 (owner: XDG Window Late)
[LOG] [16:59:35:956] Registered signal for owner 4605140: 45eaff0 -> 46053b0 (owner: XDG Window Late)
[LOG] [16:59:35:956] Registered signal for owner 45f3620: 4605000 -> 45f3698 (owner: SurfaceTreeNode)
[LOG] [16:59:35:956] Registered signal for owner 45f3620: 4604fd0 -> 45f3700 (owner: SurfaceTreeNode)
[LOG] [16:59:35:956] Registered signal for owner 45f3620: 4605010 -> 45f3768 (owner: SurfaceTreeNode)
[LOG] [16:59:35:956] Creating a surfaceTree Root! (pWindow: 4605140)
[LOG] [16:59:35:957] Map request dispatched, monitor eDP-1, xywh: 1553.500000 2674.500000 1692.000000 902.400000
[LOG] [16:59:35:959] Searching for matching rules for wezterm-scratchpad (title: zsh)
[LOG] [16:59:35:960] Window rule size 75% 60% -> ^(wezterm-scratchpad)$ matched 4605140 [zsh]
[LOG] [16:59:35:960] Window rule float -> ^(wezterm-scratchpad)$ matched 4605140 [zsh]
[LOG] [16:59:35:960] Window rule workspace special silent -> ^(wezterm-scratchpad)$ matched 4605140 [zsh]
[LOG] [16:59:35:960] Window 4605140 set title to zsh
[LOG] [16:59:35:983] Hyprctl: dispatcher moveworkspacetomonitor : special:scratch_term eDP-1
[LOG] [16:59:35:984] Searching for matching rules for wezterm-scratchpad (title: zsh)
[LOG] [16:59:35:984] Window rule size 75% 60% -> ^(wezterm-scratchpad)$ matched 4605140 [zsh]
[LOG] [16:59:35:984] Window rule float -> ^(wezterm-scratchpad)$ matched 4605140 [zsh]
[LOG] [16:59:35:984] Window rule workspace special silent -> ^(wezterm-scratchpad)$ matched 4605140 [zsh]
[LOG] [16:59:35:985] Set keyboard focus to surface 45a1f20, with window name: python3.10
[LOG] [16:59:35:985] Hyprctl: dispatcher movetoworkspacesilent : 1,address:0x4605140
[LOG] [16:59:35:986] Hyprctl: dispatcher movewindowpixel : exact 1074 2220,address:0x4605140
[LOG] [16:59:35:987] Focusing to window name: zsh
[LOG] [16:59:35:987] Set keyboard focus to surface 4604d00, with window name: zsh
[LOG] [16:59:35:987] Hyprctl: dispatcher focuswindow : address:0x4605140

from pyprland.

fdev31 avatar fdev31 commented on June 1, 2024

If you don't set an animation, or don't make it lazy, does it have an impact?
If you are able to run the git version I would appreciate new logs...

from pyprland.

dantefromhell avatar dantefromhell commented on June 1, 2024

Thx for looking into this @fdev31. I hope the tests below help, I figured I better test all combinations of config options you recommended.

If you are able to run the git version I would appreciate new logs...
I can - this is based on pyprland@f4597f4 in a custom fork that has packaging for NixOS.

Config as in OP, minus the requested test-cases

Lazy = Y Lazy = N
Animation=Y Test1 Test2
Animation=N Test3 Test4

Test1
Pressing keyboard shortcut first time starts anytype TWICE, but does not display scratchpad.
Pressing keyboard shortcut again leads to a python stacktrace.
Log: https://gist.github.com/dantefromhell/890e5a604b550833c7d6a6ef2a1f75e9

Test2
Anytype is started automatically.
Pressing keyboard shortcut once/ repeatedly leads to a python stacktrace
Log: https://gist.github.com/dantefromhell/ebaba10bcb98dffea5bfe68e0f576109

Test3
Pressing keyboard shortcut first time starts anytype, but does not display scratchpad.
Pressing keyboard shortcut repeatedly does not show the scratchpad
Log: https://gist.github.com/dantefromhell/7740443bed6669b1cb9d1ea412d4c387

Test4
Anytype is started automatically.
Pressing keyboard shortcut leads to a python stacktrace but only for the show action, not the hide action.
Log: https://gist.github.com/dantefromhell/71f6fc7e15e2a010b0bdaac870e27210

from pyprland.

fdev31 avatar fdev31 commented on June 1, 2024

Ok, I suspect this is a case like emacs client, where the windows aren't matching the process pid...

May you try https://github.com/hyprland-community/pyprland/wiki/Troubleshooting#disable-pid-tracking-eg-emacsclient after identifying the class of the window ?

If it's not working for you, can you, after trying to show anytype in a scratchpad:

  • send me the pypr logs (use latest git, I added a couple of lines that may be useful)
  • ps axuw (you can filter to show only the processes of interest)
  • hyprctl clients -j

from pyprland.

fdev31 avatar fdev31 commented on June 1, 2024

Good point, I'll add it, I considered it a hack for very few software, but if it can avoid some troubles I'll make it more visible.

from pyprland.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.