There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Rule to allow tearing for all games launched via Steam in Sway and Hyprland

So both Sway and Hyprland now support Waylands' tearing protocol. I was wondering whether it is possible to create window rules for these WMs that allow tearing in all games launched via Steam. Something like:
For Sway
for_window [class="steam_app_*"] allow_tearing yes

and for Hyprland
windowrulev2 = immediate, class:^(steam_app_*)$

Does anybody know whether something like this would work? You know, instead of having to create an entry for every single game.

mranderson17 , (edited )

Are your games all wine/proton games? For me in sway they all have the same class followed by some uid thing:


<span style="color:#323232;">] > swaymsg -t get_tree
</span><span style="color:#323232;">[...]
</span><span style="color:#323232;">  #92: output "DP-5"
</span><span style="color:#323232;">    #70: workspace "21"
</span><span style="color:#323232;">      #126: con "Automobilista 2" (xwayland, pid: 171976, instance: "steam_app_1066890", class: "steam_app_1066890", X11 window: 0x5400001)
</span>

Or gamescope:


<span style="color:#323232;">] > swaymsg -t get_tree
</span><span style="color:#323232;">[...]
</span><span style="color:#323232;">  #92: output "DP-5"
</span><span style="color:#323232;">    #70: workspace "21"
</span><span style="color:#323232;">      #124: con "Assetto Corsa" (xdg_shell, pid: 170694, app_id: "gamescope")
</span>

EDIT: Also allow_tearing was added to master 3 weeks ago, so this is definitely not in the current release. FYI to anyone who might try it.

bjornsno ,

If I may ask, why do we want to enable tearing now? There are pages and pages across the wikis on how to fix tearing…

Zenzio OP , (edited )

In general you are right. We want to avoid screen tearing. Gaming doesn't have to be but can be an exception. If you were to play some fast paced game like a competitive shooter for example. Then permitting tearing would reduce latency.
In my case, I can feel the difference when tearing is allowed in The Finals. It is easier to follow the target with your crosshair. That doesn't mean everyone would feel the same.
Nvidia's driver version 560 also got released recently. That might have something to do with me perceiving the gameplay as more smooth. All I'm saying is, smooth and enjoyable gameplay not only depends on a high fps count. Framerate, frame pacing, and latency are all factors in this.

Oh, and by the way. this doesn't at all mean that one is going to see/perceive any screen tearing when this is enabled. I haven't noticed any at all. I'm sure one could find some when one was to go and really look for it. I'm simply not too sensitive about that stuff.

GustavoM ,
@GustavoM@lemmy.world avatar

…instead of having to create an entry for every single game.

I think I might be shot and burnt alive in a cross for saying this, but… have you tried adding class=“*” instead of restricting it to the steam client only? Oh, and I tried this on my opi zero 3 and it works. The performance boost was really noticeable.

Zenzio OP ,

I think that would enable tearing for all windows no matter what they are as long as they are fullscreen. I'm not sure that would be desirable. Although I lack the knowledge to judge this. So sure, that is an option. I would really like to restrict this to games only, though.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines