Author Topic: Using Compton in Xfce for a tear-free experience  (Read 17185 times)

0 Members and 2 Guests are viewing this topic.

Offline aaditya

  • OpenRC Team
  • ****
  • Posts: 2844
    • My Website
  • Branch: Testing
  • Desktop: Xfce, Openbox
  • GPU Card: Intel HD 4000
  • Kernel: Linux 4.4 x86_64
  • Skill: Intermediate
Using Compton in Xfce for a tear-free experience
« on: 24. January 2015, 13:34:40 »
People who are experiencing screen tearing in Xfce can try out the following method.

Step 1: Installing compton
Compton is an X compositor which supports xrender and glx (opengl) backends.

To install it from the command line:
sudo pacman -S compton

Step 2: Configuring compton
Compton can be configured by editing ~/.config/compton.conf

The following are some commonly used options:
Code: [Select]
backend = "glx";
paint-on-overlay = true;
glx-no-stencil = true;
vsync = "opengl-swc";

# Shadow
shadow = true; # Enabled client-side shadows on windows.
no-dock-shadow = true; # Avoid drawing shadows on dock/panel windows.
no-dnd-shadow = true; # Don't draw shadows on DND windows.
clear-shadow = true; # Zero the part of the shadow's mask behind the window (experimental).
shadow-radius = 7; # The blur radius for shadows. (default 12)
shadow-offset-x = -7; # The left offset for shadows. (default -15)
shadow-offset-y = -7; # The top offset for shadows. (default -15)
shadow-exclude = [
  "n:e:Notification",
  "n:e:Docky",
  "g:e:Synapse",
  "g:e:Conky",
  "n:w:*Firefox*",
  "n:w:*Chromium*",
  "n:w:*dockbarx*",
  "class_g ?= 'Cairo-dock'",
  "class_g ?= 'Xfce4-notifyd'",
  "class_g ?= 'Xfce4-power-manager'",
  "class_g ?= 'Notify-osd'",
  "_GTK_FRAME_EXTENTS@:c"
];

# Opacity
detect-client-opacity = true;

# Window type settings
wintypes:
{
  tooltip = { shadow = false; };
};

Step 3: Disabling xfwm4 compositor and enabling compton
The following command can be used to turn off xfwm4's compositing feature:
Code: [Select]
xfconf-query -c xfwm4 -p /general/use_compositing -s false
The following content can be pasted in ~/.config/autostart/compton.desktop
Code: [Select]
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Compton
Comment=X11 compositor
Exec=compton -b
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false

Now you could logout and login again to see if compton has been activated.

To check if compton is working following command can be used:
Code: [Select]
pgrep -l compton
Link: http://ubuntuforums.org/showthread.php?t=2144468&p=12644745#post12644745

Edit-
Wikified: https://wiki.manjaro.org/index.php?title=Using_Compton_for_a_tear-free_experience_in_Xfce
« Last Edit: 24. January 2015, 16:11:55 by aaditya »

Offline walker17x

  • Neuling
  • *
  • Posts: 38
  • Branch: Stable
  • Desktop: XFCE
  • GPU Card: Nvidia GTS 250
  • GPU driver: 340.65
  • Kernel: 3.18.x
  • Skill: Intermediate
Re: Using Compton in Xfce for a tear-free experience
« Reply #1 on: 24. January 2015, 15:52:33 »
Thank you  :D

Offline excalibur1234

  • Global Moderator
  • *****
  • Posts: 2508
  • Branch: unstable
  • Desktop: net-minimal + LXQt
  • GPU driver: video-nouveau
  • Kernel: 4.6
  • Skill: Intermediate
Re: Using Compton in Xfce for a tear-free experience
« Reply #2 on: 24. January 2015, 17:33:30 »
screen tearing is always a problem. i have tried MANY different solutions. here is the only working tear-free experience i can achieve with compton:

1. :
disable your compositor (e.g. in xfwm4 or kwin).

2. :
install compton:
Code: [Select]
yaourt -S compton

3. :
autostart compton with the following code (this has to be done differently in different DE):
Code: [Select]
compton --opengl


at least some people have the same problem as me with screen tearing:
https://forum.manjaro.org/index.php?topic=13572.msg122640#msg122640
https://forum.manjaro.org/index.php?topic=9564.0
Need more information? Search here:   Manjaro Forum   |   Manjaro Wiki   |   Arch Wiki

Offline Rob

  • Core Team
  • *****
  • Posts: 5390
  • Alias: Korrode
  • Branch: Unstable
  • Desktop: Xfce+Compiz
  • GPU Card: nVidia GTX560Ti
  • GPU driver: non-free
  • Kernel: linux314 x64
  • Skill: Advanced
Re: Using Compton in Xfce for a tear-free experience
« Reply #3 on: 24. January 2015, 17:45:04 »
3. :
autostart compton with the following code (this has to be done differently in different DE):
Code: [Select]
compton --opengl

Aaditya's guide uses the GLX backend (set via config file instead of command line parameter), which is the same as using the command you list. ;)

Sidenote about Compton: It's been used as the compositor in the Netbook edition from day one, xfwm4-manjaro-netbook doesn't even have it's own compositing feature enabled.
Compton FTW! :D

Offline rago1975

  • Neuling
  • *
  • Posts: 43
  • Branch: stable
  • Desktop: Xfce/LXQt
  • GPU Card: Intel (on board)
  • GPU driver: free
  • Kernel: linux41-x86_64
  • Skill: Novice
Re: Using Compton in Xfce for a tear-free experience
« Reply #4 on: 24. January 2015, 23:06:57 »
Thanks a lot.
My problem was solved by this method.
I was bothered the problem from update on 2015-01-17.
Japanese Manjaro Linux user. http://www.rago1975.net/ (written by Japanese)
Manjaro JP project . http://sourceforge.net/projects/manjarojp/

Offline fkervin

  • Neuling
  • *
  • Posts: 6
  • Skill: Novice
Re: Using Compton in Xfce for a tear-free experience
« Reply #5 on: 12. February 2015, 09:20:25 »
Many thaks for this post aaditya,

I use xfce4 and some time ago I found this was the only way to get rir of tearing.

Regards

Offline capoderra

  • Neuling
  • *
  • Posts: 1
  • Skill: Novice
Re: Using Compton in Xfce for a tear-free experience
« Reply #6 on: 22. February 2015, 02:41:40 »

To check if compton is working following command can be used:
Code: [Select]
pgrep -l compton

After entering the above command, it prints:
2842 compton
So, does that mean success?

Offline aaditya

  • OpenRC Team
  • ****
  • Posts: 2844
    • My Website
  • Branch: Testing
  • Desktop: Xfce, Openbox
  • GPU Card: Intel HD 4000
  • Kernel: Linux 4.4 x86_64
  • Skill: Intermediate
Re: Using Compton in Xfce for a tear-free experience
« Reply #7 on: 22. February 2015, 07:46:34 »
After entering the above command, it prints:
2842 compton
So, does that mean success?
Yes, that means that the process (compton) is running with pid (process id) 2842.

Offline DopeFish

  • Neuling
  • *
  • Posts: 19
    • olemagnuskarlsen@blogspot.com
  • Desktop: Xfce
  • GPU Card: nVidia EVGA GTX 980 SC ACX 2.0
  • GPU driver: non-free
  • Skill: Intermediate
Re: Using Compton in Xfce for a tear-free experience
« Reply #8 on: 22. February 2015, 21:49:06 »
This worked great for tearing in firefox for me, but my coursor dissapears when moving it to the top of the screen.

Offline PivPav

  • Neuling
  • *
  • Posts: 6
  • Desktop: XFCE
  • GPU Card: Intel HD3000
  • GPU driver: intel
  • Kernel: 3.19
  • Skill: Advanced
Re: Using Compton in Xfce for a tear-free experience
« Reply #9 on: 18. March 2015, 02:38:23 »
If you are using Intel HD videocard, only thing you need is just activate TearFree in xorg.
Just create file

/usr/share/X11/xorg.conf.d/50-intel.conf

Code: [Select]
Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "TearFree" "true"
EndSection

Don't forget to restart X server (logout will be enough)
« Last Edit: 18. March 2015, 02:43:15 by PivPav »

Offline artvision

  • Neuling
  • *
  • Posts: 11
  • Branch: Stable
  • Desktop: Xfce
  • GPU Card: Ati
  • Kernel: linux3.18
  • Skill: Novice
Re: Using Compton in Xfce for a tear-free experience
« Reply #10 on: 23. May 2015, 02:13:39 »
Hi all,

Just enabled Compton by following the steps in the first post (from aaditya) loged out and my screen freezed. As soon as I enter my password the screen freezes. Any idea how to fix it?

Offline artvision

  • Neuling
  • *
  • Posts: 11
  • Branch: Stable
  • Desktop: Xfce
  • GPU Card: Ati
  • Kernel: linux3.18
  • Skill: Novice
Re: Using Compton in Xfce for a tear-free experience
« Reply #11 on: 23. May 2015, 02:42:40 »
I managed to disable ~/.config/autostart/compton.desktop in failsafe mode and now I am in
but the problem is not solved. Any hint what could cause the issue?

EDIT: Looks like xfwm4 is running now.
« Last Edit: 23. May 2015, 02:49:27 by artvision »

Offline aaditya

  • OpenRC Team
  • ****
  • Posts: 2844
    • My Website
  • Branch: Testing
  • Desktop: Xfce, Openbox
  • GPU Card: Intel HD 4000
  • Kernel: Linux 4.4 x86_64
  • Skill: Intermediate
Re: Using Compton in Xfce for a tear-free experience
« Reply #12 on: 23. May 2015, 04:57:26 »
I managed to disable ~/.config/autostart/compton.desktop in failsafe mode and now I am in
but the problem is not solved. Any hint what could cause the issue?

EDIT: Looks like xfwm4 is running now.
Hi,

Maybe an issue with your graphics card or drivers..
You could try vsync method. From man compton:
Quote
       --vsync VSYNC_METHOD
           Set VSync method. VSync methods currently available:

           ·    none: No VSync

           ·    drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.

           ·    opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.

           ·    opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.

           ·    opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only
               with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing,
               only buffer swap is affected, so it doesn’t have the effect of --sw-opti unlike other methods.
               Experimental.

           ·    opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc
               above, except the extension we use.

           (Note some VSync methods may not be enabled at compile time.)

You could try starting compton manually with above option(s) to see what happens.

Also, you could report a problem with the compton developers with details of your setup (system, graphics card and drivers, etc) here:
https://github.com/chjj/compton

Offline artvision

  • Neuling
  • *
  • Posts: 11
  • Branch: Stable
  • Desktop: Xfce
  • GPU Card: Ati
  • Kernel: linux3.18
  • Skill: Novice
Re: Using Compton in Xfce for a tear-free experience
« Reply #13 on: 23. May 2015, 11:28:07 »
I will try it. Thank you @aaditya

Offline gonza85

  • Neuling
  • *
  • Posts: 1
  • Skill: Novice
Re: Using Compton in Xfce for a tear-free experience
« Reply #14 on: 04. August 2015, 21:38:15 »
thak you..
« Last Edit: 04. August 2015, 21:48:47 by gonza85 »