Giter VIP home page Giter VIP logo

hyprfreeze's Issues

No sound in other programs when pausing a Linux native game (e.g. Minecraft)

I have encountered an issue when using this script with Minecraft... when using this script to pause a running Minecraft client, any other audio being played (I use Pipewire) is muted (the clip/video/program continues running). This seems to be one-way; audio in MC does not shut down when I pause the other app.

Mouse input doesn't work inside Xorg/XWayland windows while a Wine/Proton game is paused

This issue happens when pausing a game while the mouse cursor is inside the game window. It's like the mouse cursor gets paused too, and is stuck in that state (Proton games run in XWayland), so it stops working in other XWayland windows too.


This issue is apparently only present when running the script via a keybind.

For some reason running the same script in a terminal (by manually assigning the game process to the PID variable) works as intended and mouse input works correctly in other Xorg/XWayland windows.

Script I ran in terminal which works as intended:

PID=26043 #Manually assign pid of a game
PIDS=$(pstree $PID -npl | grep -oP '(?<=\()[0-9]+(?=\))')

kill -STOP $PIDS

Pausing a game running in gamescope also works as intended.

EDIT

On further analysis it looks like this issue only happens when pausing a game while the mouse cursor is inside the game window.

If I add a sleep timer like this

if [[ "$(ps -o state= $PID)" == S ]]; then
        sleep 3 #timer
        kill -STOP $PIDS
	exit 0
fi

run the script from keybind, and quickly move the mouse cursor out of the game window, the game gets paused after 3 seconds and the mouse works correctly in other XWayland windows.
Not sure how to proceed right now as this should be fixed in a way that still allows pausing the game instantaneously.

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.