Screen tearing in Xubuntu, no problem with Ubuntu

14,625

Note: these directions have been abridged from the original source of Duncan Lock's blog.


  1. Disable XFCE's built-in compositor:

    enter image description here


  1. Open up a terminal, and run these commands:

     sudo apt-get update
     sudo apt-get install compton
     cd ~/.config
     nano compton.conf
    

  1. Paste this into Nano (see here for a commented version):

    backend = "glx";
    glx-no-stencil = true;
    glx-copy-from-front = false;
    glx-swap-method = "undefined";
    shadow = true;
    no-dnd-shadow = true;
    no-dock-shadow = true;
    clear-shadow = true;
    shadow-radius = 5;
    shadow-offset-x = -5;
    shadow-offset-y = -5;
    shadow-opacity = 0.5;
    shadow-exclude = [
        "! name~=''",
        "name = 'Notification'",
        "name = 'Plank'",
        "name = 'Docky'",
        "name = 'Kupfer'",
        "name = 'xfce4-notifyd'",
        "name *= 'VLC'",
        "name *= 'compton'",
        "name *= 'Chromium'",
        "name *= 'Chrome'",
        "name *= 'Firefox'",
        "class_g = 'Conky'",
        "class_g = 'Kupfer'",
        "class_g = 'Synapse'",
        "class_g ?= 'Notify-osd'",
        "class_g ?= 'Cairo-dock'",
        "class_g ?= 'Xfce4-notifyd'",
        "class_g ?= 'Xfce4-power-manager'"
    ];
    shadow-ignore-shaped = false;
    menu-opacity = 1;
    inactive-opacity = 1;
    active-opacity = 1;
    frame-opacity = 1;
    inactive-opacity-override = false;
    alpha-step = 0.06;
    blur-background-fixed = false;
    blur-background-exclude = [
        "window_type = 'dock'",
        "window_type = 'desktop'"
    ];
    fading = true;
    fade-delta = 4;
    fade-in-step = 0.03;
    fade-out-step = 0.03;
    fade-exclude = [ ];
    mark-wmwin-focused = true;
    mark-ovredir-focused = true;
    use-ewmh-active-win = true;
    detect-rounded-corners = true;
    detect-client-opacity = true;
    refresh-rate = 0;
    vsync = "opengl-swc";
    dbe = false;
    paint-on-overlay = true;
    sw-opti = false;
    unredir-if-possible = true;
    focus-exclude = [ ];
    detect-transient = true;
    detect-client-leader = true;
    wintypes:
    {
        tooltip =
        {
            fade = true;
            shadow = false;
            opacity = 0.85;
            focus = true;
        };
    };
    

  1. Press CTRL+X and then Y and then Enter to save and exit.

  1. Now, run this command: compton

    Your screen will flicker, and you will no longer have screen tearing!


  1. Finally, just add it to your startup applications:

    enter image description here

Share:
14,625

Related videos on Youtube

You'reAGitForNotUsingGit
Author by

You'reAGitForNotUsingGit

Updated on September 18, 2022

Comments

  • You'reAGitForNotUsingGit
    You'reAGitForNotUsingGit almost 2 years

    I have both Ubuntu 14.04 and Xubuntu 16.04 installed on one of my older desktops.

    While both work fine, I experience screen tearing while dragging windows around in Xubuntu. However, I do not experience it on Ubuntu.

    It is using the motherboard's built-in AMD graphics chip.

    Note: This exact situation also holds true for my main desktop with a GTX650 graphics card...


    At this point, I'm thinking it has something to do with Untiy being a 3D DE, and XFCE being a 2D DE...

    • Muaad ElSharif
      Muaad ElSharif over 7 years
      Could you provide a screenshot of the said tear?
    • You'reAGitForNotUsingGit
      You'reAGitForNotUsingGit over 7 years
      @MuaadElSharif - I found the solution
    • Santropedro
      Santropedro over 4 years
      I screenshoted my tearing screen and it showed screen tearing at a different place than which I perceive it with my eyes. I'm sure it's not a optical illusion. Screenshots are not accurate representation of what is exactly happening on the screen.
  • drewburr
    drewburr about 7 years
    This worked for me with Ubuntu 16.04 on my Dell XPS 13! I use i3, so I skipped the first step :)
  • mja
    mja over 6 years
    Another instruction: duncanlock.net/blog/2013/06/07/…
  • aultimus
    aultimus over 5 years
    I'm running ubuntu mate 18.04 and I was able to switch compositor simply without the commandline, using the mate tweak utility which comes pre-installed, this resolved the issue for me.
  • Terrance
    Terrance over 5 years
    @aultimus This is for Xfce (Xubuntu) desktop. Mate has a different compositor that this answer probably won't help.
  • Santropedro
    Santropedro over 4 years
    I just did this and it worked for me, no more tearing, BUT the "compton" command doesn't close the terminal, it keeps open. That is weird and acward. If I close the terminal, I have to force close the process, and the tearing naturally comes back. It seems the compton program doesn't close its own terminal.