Difference between revisions of "Compositor (X11)"

From Linux Gaming
Jump to navigation Jump to search
 
(55 intermediate revisions by 6 users not shown)
Line 1: Line 1:
If you use a DE with X11, then you probably have a compositor. The compositor does nice things like window shadow and effects. But it also reduces fps, adds input lag, and introduces stuttering. That's why you should disable it when running a game.
[[Misc#Test whether you use X11|If you use a DE with X11]], then you probably have a compositor. The compositor does nice things like window shadows, animations, transparency, blur, or other effects. But it also reduces fps, adds input lag, and introduces stuttering. That's why you should disable it when running a game. You can verify that composition is disabled, by looking at your desktop effects. For example, you should not see shadows. They either vanish, or get pitch black.


==Disabling composition for your games==
==Disabling composition for your games==
{{Needs work|Problem=I don't know whether the procedure for disabling composition in Cinnamon actually works. In case this does not work, you should not be using Cinnamon. If you want a DE that looks a bit like Windows, you should choose KDE Plasma instead. Please edit if you know more}}


Disabling composition will dramatically improve input lag and ''"smoothness"''. Here is how to do it:
Disabling composition will dramatically improve performance, input lag, and ''"smoothness"''. Here is how to do it:


*If you use KDE:  
===GNOME===
**For Lutris: Right click the game -> <code>Configure</code> -> <code>System options</code> -> <code>Disable desktop effects</code>.  
This is the default DE on Pop!_OS, and Nobara GNOME.
**For Steam, Heroic or others: You have to manually disable composition with <code>shift</code> + <code>alt</code> + <code>f12</code>. The same combination re-enables it.
 
*If you use Gnome: You don't have to do anything.
You don't have to do anything. Gnome uses unredirection (the same thing Windows does), which is almost as good as disabling compositon. Disabling composition in Gnome is not possible.
*If you use Cinnamon: Go to <code>settings</code> -> <code>general</code> -> <code>disable compositing for full-screen window</code>
 
===KDE===
This is the default DE on SteamOS, Nobara Official, and Nobara KDE.
 
There are many options to disable composition:
 
* You can use [https://store.kde.org/p/1502826/ Autocomposer]. This should make it unnecessary to do anything of the following.
 
*For Lutris:
**To disable it for a single game: Right click the game -> <code>Configure</code> -> <code>System Options</code> -> <code>Disable desktop effects</code>.
**To disable it for all games: Click <code>...</code> in the top right corner -> <code>Preferences</code> -> <code>Global Options</code> -> <code>Disable desktop effects</code>
*You can manually disable composition with <code>shift</code> + <code>alt</code> + <code>f12</code> before launching a game. The same combination re-enables it.
*If you want to use a terminal command (for example for automation, launch options for Steam, [[Gamemode]] etc):
** disable: <code>qdbus org.kde.KWin /Compositor suspend</code>
** enable: <code>qdbus org.kde.KWin /Compositor resume</code>
*You can also disable it completely with <code>System Settings</code> -> <code>Display and Monitor</code> -> <code>Compositor</code> -> <code>Enable compositor on startup</code>.
 
===Xfce===
*Disable composition with <code>xfconf-query -c xfwm4 -p /general/use_compositing -s false</code><ref>https://wiki.archlinux.org/title/Xfwm#Configuration</ref>
*Enable it again with <code>xfconf-query -c xfwm4 -p /general/use_compositing -s true</code>
 
=== Mate ===
 
* Disable composition: <code>gsettings set org.mate.Marco.general compositing-manager false</code><ref>https://wiki.archlinux.org/title/MATE#Disabling_compositing</ref>
* Enable composition: <code>gsettings set org.mate.Marco.general compositing-manager true</code>
 
===Cinnamon ===
{{Needs work|Problem=There are (old) reports that Cinnamon does not always automatically disable composition for full screen windows. Is this still the case, or is this resolved?
Reported to work fine Cinnamon with 5.8.4 and does result in noticeable gain. ([[User:Jul|Jul]] ([[User talk:Jul|talk]]))
 
}}
*As of Cinnamon 5.4, there's an option to disable composition for fullscreen applications, essentially referring to unredirection. However, it is disabled by default, forcing composition on all apps, making it not ideal. To enable it: <code>System Settings</code> -> <code>General</code> -> <code>Disable compositing on fullscreen applications</code>
*Disabling composition completely might lead to better input lag. You can do that by checking: <code>System Settings</code> -> <code>General</code> -> <code>Disable compositing</code>. However, this might lead to visual degradation in desktop mode (no effects, no shadows, no transparency, no window previews, more tearing), but is still recommended if you want to reduce latency.
Linux mint does not seem to support disabling it anymore.
 
 
===Pantheon===
Unfortunately it appears to not support the option to disable composition.<ref>https://elementaryos.stackexchange.com/questions/4483/how-can-i-disable-composite-and-effects-in-elementary-os</ref>
 
==Automation ==
For DEs that support disabling/enabling the compositor with a terminal command, you can automate it. In the following <code><disable></code> and <code><enable></code> are to be replaced with the respective command to disable or enable the compositor.
 
===Gamemode===
The easiest way is to automate it with [[gamemode]]. You can edit <code>gamemode.ini</code> and set <syntaxhighlight lang="ini">
[custom]
start=<disable>
end=<enable>
</syntaxhighlight>Replace <code><disable></code> and <code><enable></code> with the respective commands that disable/enable composition.
 
===Lutris===
 
*To automate this for a single game: Right click a game -> <code>Configure</code> -> <code>System Options</code> and put the disable composition command in the <code>Pre-launch</code> box and the enable composition command in the <code>Post-exit</code> script box.
 
*To automate this for all games: Click the hamburger menu -> <code>Preferences</code> -> <code>Global Options</code> and do the things mentioned in the previous method.
 
===Steam===
Set the launch command <code><disable>; %command%; <enable></code>.
 
For example <code>xfconf-query -c xfwm4 -p /general/use_compositing -s false; %command%; xfconf-query -c xfwm4 -p /general/use_compositing -s true</code> to disable composition on Xfce<ref>https://www.reddit.com/r/GlobalOffensiveLinux/comments/6b3cs5/comment/dhjw7z7/?context=3</ref>.
 
==References and notes==
<references />

Latest revision as of 12:24, 1 January 2024

If you use a DE with X11, then you probably have a compositor. The compositor does nice things like window shadows, animations, transparency, blur, or other effects. But it also reduces fps, adds input lag, and introduces stuttering. That's why you should disable it when running a game. You can verify that composition is disabled, by looking at your desktop effects. For example, you should not see shadows. They either vanish, or get pitch black.

Disabling composition for your games

Disabling composition will dramatically improve performance, input lag, and "smoothness". Here is how to do it:

GNOME

This is the default DE on Pop!_OS, and Nobara GNOME.

You don't have to do anything. Gnome uses unredirection (the same thing Windows does), which is almost as good as disabling compositon. Disabling composition in Gnome is not possible.

KDE

This is the default DE on SteamOS, Nobara Official, and Nobara KDE.

There are many options to disable composition:

  • You can use Autocomposer. This should make it unnecessary to do anything of the following.
  • For Lutris:
    • To disable it for a single game: Right click the game -> Configure -> System Options -> Disable desktop effects.
    • To disable it for all games: Click ... in the top right corner -> Preferences -> Global Options -> Disable desktop effects
  • You can manually disable composition with shift + alt + f12 before launching a game. The same combination re-enables it.
  • If you want to use a terminal command (for example for automation, launch options for Steam, Gamemode etc):
    • disable: qdbus org.kde.KWin /Compositor suspend
    • enable: qdbus org.kde.KWin /Compositor resume
  • You can also disable it completely with System Settings -> Display and Monitor -> Compositor -> Enable compositor on startup.

Xfce

  • Disable composition with xfconf-query -c xfwm4 -p /general/use_compositing -s false[1]
  • Enable it again with xfconf-query -c xfwm4 -p /general/use_compositing -s true

Mate

  • Disable composition: gsettings set org.mate.Marco.general compositing-manager false[2]
  • Enable composition: gsettings set org.mate.Marco.general compositing-manager true

Cinnamon

This page needs work, for the following reason(s): There are (old) reports that Cinnamon does not always automatically disable composition for full screen windows. Is this still the case, or is this resolved? Reported to work fine Cinnamon with 5.8.4 and does result in noticeable gain. (Jul (talk)).
  • As of Cinnamon 5.4, there's an option to disable composition for fullscreen applications, essentially referring to unredirection. However, it is disabled by default, forcing composition on all apps, making it not ideal. To enable it: System Settings -> General -> Disable compositing on fullscreen applications
  • Disabling composition completely might lead to better input lag. You can do that by checking: System Settings -> General -> Disable compositing. However, this might lead to visual degradation in desktop mode (no effects, no shadows, no transparency, no window previews, more tearing), but is still recommended if you want to reduce latency.

Linux mint does not seem to support disabling it anymore.


Pantheon

Unfortunately it appears to not support the option to disable composition.[3]

Automation

For DEs that support disabling/enabling the compositor with a terminal command, you can automate it. In the following <disable> and <enable> are to be replaced with the respective command to disable or enable the compositor.

Gamemode

The easiest way is to automate it with gamemode. You can edit gamemode.ini and set

[custom]
start=<disable>
end=<enable>

Replace <disable> and <enable> with the respective commands that disable/enable composition.

Lutris

  • To automate this for a single game: Right click a game -> Configure -> System Options and put the disable composition command in the Pre-launch box and the enable composition command in the Post-exit script box.
  • To automate this for all games: Click the hamburger menu -> Preferences -> Global Options and do the things mentioned in the previous method.

Steam

Set the launch command <disable>; %command%; <enable>.

For example xfconf-query -c xfwm4 -p /general/use_compositing -s false; %command%; xfconf-query -c xfwm4 -p /general/use_compositing -s true to disable composition on Xfce[4].

References and notes