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

Crash when trying to gobble terminal that isn't focused #11

Open
SeerLite opened this issue Mar 5, 2024 · 4 comments
Open

Crash when trying to gobble terminal that isn't focused #11

SeerLite opened this issue Mar 5, 2024 · 4 comments

Comments

@SeerLite
Copy link

SeerLite commented Mar 5, 2024

Describe the bug
If the terminal isn't focused when the new window is opened, gobble crashes leaving the command running in a weird state where the terminal/stdin is shared between the called shell/program and the gobbled command.

To Reproduce
Steps to reproduce the behavior:
Having mpv installed, run the following expression in a shell. While sleeping, minimize/unfocus all windows.

sleep 5; gobble mpv --force-window --idle

Expected behavior
gobble doesn't unmap/hide any windows nor does it exit to the shell/calling command. mpv runs as if it was called directly.

Additional context
Version 1.3 from nixpkgs

@peter-lyons-kehl
Copy link

peter-lyons-kehl commented Mar 8, 2024

Reproduced (with Konsole, on X11, GNOME, Manjaro = stable Arch x64 Linux, current main (68cb9c5) installed with makepkg -si).
image

(UPDATE: I've moved the previous content about terminal-specific behaviour to #12.)

@peter-lyons-kehl
Copy link

peter-lyons-kehl commented Mar 8, 2024

Hi @EmperorPenguin18, if this issue is confirmed, suggest re-using some code from https://github.com/Liupold/pidswallow. Its README.md > Features says: "Based on process hierarchy (don't care about window focus)".
(Plus, Liupold/pidswallow is also Arch-friendly, AUR-distributed.)
Though, that requires the child window ID - can we get it in any way?

If that would slow gobble too much, maybe there could be two executables (rather than an option, which makes it awkward). For example gobble (current behaviour) and gobble-any-focus?

@peter-lyons-kehl
Copy link

FYI same problem with Devour (an older alternative, written in C, even less maintained, unfortunately): salman-abedin/devour#39.

@EmperorPenguin18
Copy link
Owner

I can reproduce the issue and have pushed a change to main. Try it to see if that fixes the crash for you. I have a feeling this may be window manager dependent, because I had to jump through some hoops to be able to manually iconify a window.

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

3 participants