Picom: Support NET_WM_BYPASS_COMPOSITOR

Created on 18 Nov 2019  路  8Comments  路  Source: yshui/picom

Wine, Proton, Lutris etc. can set a hint on a window (NET_WM_BYPASS_COMPOSITOR) for which compositing should be disabled. This helps especially for performance in games.

It would be really nice if picom could support this. I'm aware of --unredir-if-possible, however that only works for fullscreen windows and I think implementing this defacto-standard would be a good idea either way.

All other compositors from the bigger DEs support this.

enhancement

Most helpful comment

For the programs that use _NET_WM_BYPASS_COMPOSITOR to tell the compositor to keep redirection enabled for their fullscreen window, you can write a rule for the "unredir-if-possible-exclude" config entry:

unredir-if-possible-exclude = [
    "_NET_WM_BYPASS_COMPOSITOR@:c = 2",
];

Chrome/Chromium uses this. That's the program I tried to use to test that this rule here actually works.

@FaithLV: About "exclusive fullscreen", from what I understood that method doesn't actually exist in X. Fullscreen in X is actually always what's called "borderless windowed" in Windows. I'm guessing the games that show both an "exclusive" and a "borderless" option in their menus, that's just because the game inherits the setting from its Windows version.

All 8 comments

Gnome can't turn off compositing for non-fullscreen windows. KWin can do that, but that's probably rather for the silly reason that it lacks unredirect. Turning off compositing for non-fullscreen breaks vsync in every window if TearFree isn't used, how would that be beneficial?

I think if picom would just unredirect the whole screen if it detects NET_WM_BYPASS_COMPOSITOR would be great already.

Aren't you a bit biased here? I mean this hint exists for a reason and it's a real use-case. Just brushing it off doesn't sound very constructive to me. It could be an opt-in option just like the others and a second (and probably proper) way of unredirecting instead of just looking for fullscreen windows.

Because why would I like to lose vsync just because I fullscreened a window?

Just stating my opinion, no need to get sensitive. It would make sense if Picom honored it by default for fullscreen windows, sure.

You btw. don't lose vsync for fullscreen windows in general, only of the compositor.

This would be great! Playing any games while _picom_ with i3 is running is not a great experience, as I don't want any games running exclusive fullscreen. Also never had any luck with --unredir-if-possible even in fullscreen games.

Currently, my solution is dynperf because killing/restoring _picom_ manually gets tiresome.

For the programs that use _NET_WM_BYPASS_COMPOSITOR to tell the compositor to keep redirection enabled for their fullscreen window, you can write a rule for the "unredir-if-possible-exclude" config entry:

unredir-if-possible-exclude = [
    "_NET_WM_BYPASS_COMPOSITOR@:c = 2",
];

Chrome/Chromium uses this. That's the program I tried to use to test that this rule here actually works.

@FaithLV: About "exclusive fullscreen", from what I understood that method doesn't actually exist in X. Fullscreen in X is actually always what's called "borderless windowed" in Windows. I'm guessing the games that show both an "exclusive" and a "borderless" option in their menus, that's just because the game inherits the setting from its Windows version.

I have implemented the _NET_WM_BYPASS_COMPOSITOR = 1 case.

@aufkrawall if you want picom to ignore this property, you can either not use --unredir-if-possible, or add this to your config:

unredir-if-possible-exclude = [
    "_NET_WM_BYPASS_COMPOSITOR@:c = 1",
];

This should help i3/i3lock#204

Was this page helpful?
0 / 5 - 0 ratings