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

Add a window rule to render while unfocused #7582

Merged
merged 4 commits into from
Aug 30, 2024
Merged

Add a window rule to render while unfocused #7582

merged 4 commits into from
Aug 30, 2024

Conversation

vaxerski
Copy link
Member

Adds a renderunfocused window rule.

Needs testing

fixes #2701

@ntnn
Copy link
Contributor

ntnn commented Aug 30, 2024

Tried it on glxgears with windowrulev2 = renderunfocused, title:^(glxgears)$, the rule was recognized but the FPS still dropped after moving it to an inactive workspace.

Edit: Made a second test with this:

windowrulev2 = tag +unfocused, title:^(glxgears)$
windowrulev2 = renderunfocused, tag:unfocused

To ensure that glxgears was getting the renderunfocused flag and it did:

Window 5c71fc3f5090 -> glxgears:
        mapped: 1
        hidden: 0
        at: 3373,1023
        size: 300,300
        workspace: 4 (4)
        floating: 1
        pseudo: 0
        monitor: 1
        class:
        title: glxgears
        initialClass:
        initialTitle: glxgears
        pid: 2779433
        xwayland: 1
        pinned: 0
        fullscreen: 0
        fullscreenClient: 0
        grouped: 0
        tags: unfocused*
        swallowing: 0
        focusHistoryID: 2

@vaxerski
Copy link
Member Author

vaxerski commented Aug 30, 2024

it should drop to ~15 thats the current set amount.

@vaxerski
Copy link
Member Author

image
seems to be working for me

the point isnt to render at max fps all the time is it? The point is to avoid apps stalling

@ntnn
Copy link
Contributor

ntnn commented Aug 30, 2024

Oh ok - then it works, it was about 15fps.

Do you think we could get a configuration option for that?

I see that it's a timeout in milliseconds here: https://github.com/hyprwm/Hyprland/pull/7582/files#diff-dbcd1ce1e0b916536f17c999473ad9e22c014646ddb2df15c45d726884a3481cR131

I think it'd be enough to make that value configurable.

@vaxerski
Copy link
Member Author

prolly yea

@ntnn
Copy link
Contributor

ntnn commented Aug 30, 2024

the point isnt to render at max fps all the time is it? The point is to avoid apps stalling

Yeah not max fps all the time but some games (like Elden Ring as mentioned in the issue) are fps sensitive and being able to configure it would be great.

@vaxerski
Copy link
Member Author

misc:render_unfocused_fps

@ntnn
Copy link
Contributor

ntnn commented Aug 30, 2024

Works like a charm!

@vaxerski vaxerski merged commit c5fd577 into main Aug 30, 2024
19 checks passed
@myned
Copy link

myned commented Aug 30, 2024

FWIW, I had Elden Ring in the background for about 15 minutes @ 6634117 with the hardcoded 15fps while switching back and forth between workspaces, and it didn't trigger the framerate detection. The ability to configure that value is very welcome though. Thanks!

@enzi
Copy link

enzi commented Aug 31, 2024

great work! fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window rule to allow client to render when unfocused / on another workspace
4 participants