[SOLVED] Compton doesn't work correctly after restart

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Mirko

[SOLVED] Compton doesn't work correctly after restart

Post by Mirko »

Hello everyone,

I'm having a problem with screen tearing and Compton is the solution for it. Changed the window manager in Xfwm4 + Compton and everything works fine!

But every time I boot the problem reappears. Every boot I have to go to Settings > Desktop Settings and change the window manager to another one, then switch back to Xfwm4 + Compton. This makes Compton working fine without screen tearing. I have the same issue on two different PCs with different hardware.

Is there a way to avoid changing the window manager every time I boot? A command to run at startup? Setting the VSync method doesn't work and I don't know why (see first code below).

Thank you in advance for your help!

Code: Select all

mirko@A544 ~ $ compton --vsync opengl
Another composite manager is already running

Code: Select all

mirko@A544 ~ $ inxi -Fxz
System:    Host: A544 Kernel: 4.10.0-38-generic x86_64 (64 bit gcc: 5.4.0) Desktop: Xfce 4.12.3 (Gtk 2.24.28)
           Distro: Linux Mint 18.3 Sylvia
Machine:   System: FUJITSU (portable) product: LIFEBOOK A544
           Mobo: FUJITSU model: FJNBB35 Bios: FUJITSU // Phoenix v: Version 1.18 date: 12/01/2014
CPU:       Dual core Intel Core i3-4000M (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 9578
           clock speeds: max: 2400 MHz 1: 2400 MHz 2: 2399 MHz 3: 2400 MHz 4: 2400 MHz
Graphics:  Card: Intel 4th Gen Core Processor Integrated Graphics Controller bus-ID: 00:02.0
           Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa)
           Resolution: 1366x768@60.00hz, 1280x1024@60.02hz
           GLX Renderer: Mesa DRI Intel Haswell Mobile GLX Version: 3.0 Mesa 17.0.7 Direct Rendering: Yes
Audio:     Card-1 Intel 8 Series/C220 Series High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Card-2 Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller
           driver: snd_hda_intel bus-ID: 00:03.0
           Sound: Advanced Linux Sound Architecture v: k4.10.0-38-generic
Network:   Card-1: Intel Wireless 7260 driver: iwlwifi bus-ID: 03:00.0
           IF: wlp3s0 state: down mac: <filter>
           Card-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: 3000 bus-ID: 04:00.0
           IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:    HDD Total Size: 500.1GB (6.0% used) ID-1: /dev/sda model: TOSHIBA_MQ01ABF0 size: 500.1GB
Partition: ID-1: / size: 454G used: 25G (6%) fs: ext4 dev: /dev/sda2
           ID-2: swap-1 size: 4.20GB used: 0.00GB (0%) fs: swap dev: /dev/sda3
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 52.0C mobo: 27.8C
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 224 Uptime: 1:01 Memory: 1377.9/3856.9MB Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35 


SOLVED - IF YOU'RE LOOKING FOR THE SOLUTION
1. Set only Xfwm4 in Settings > Desktop Settings > Window manager
2. Run at startup (Settings > Session and Startup > Application Autostart) the command compton --backend glx --vsync opengl-swc

Another solution is to create the file $HOME/.config/compton.conf with proper settings. Then you only have to set Xfwm4 + Compton as your Window manager.

WHY? Compton at boot runs as compton and when you switch back and fort to Xfwv4 + Compton, Compton is executed as compton --backend glx --vsync opengl-swc.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 4 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pjotr
Level 23
Level 23
Posts: 19888
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Compton doesn't work correctly after restart

Post by Pjotr »

Try if it helps when you remove Compiz:

Code: Select all

sudo apt-get remove compiz-core
And while you're at it, you might try a driver change:
https://sites.google.com/site/easylinux ... l-graphics
(item 6, left column)
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Mirko

Re: Compton doesn't work correctly after restart

Post by Mirko »

Removed Compiz, but the problem remains.

Changed driver, noticed some improvements, but the problem remains. I always have to move to another window manager and then switch back to Xfmw4 + Compton.

Thank you for you help and for sharing that useful site!
User avatar
thx-1138
Level 8
Level 8
Posts: 2092
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Compton doesn't work correctly after restart

Post by thx-1138 »

Mirko wrote:

Code: Select all

mirko@A544 ~ $ compton --vsync opengl
Another composite manager is already running
It appears you might need to disable xfmw4's compositing abilities...
Mirko

Re: Compton doesn't work correctly after restart

Post by Mirko »

thx-1138 wrote:
Mirko wrote:

Code: Select all

mirko@A544 ~ $ compton --vsync opengl
Another composite manager is already running
It appears you might need to disable xfmw4's compositing abilities...
I tried disabling its compositing abilities following these instuctions, but I receive the same message saying that another composite manager is already running.
User avatar
thx-1138
Level 8
Level 8
Posts: 2092
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Compton doesn't work correctly after restart

Post by thx-1138 »

Mirko wrote:
thx-1138 wrote:
Mirko wrote:

Code: Select all

mirko@A544 ~ $ compton --vsync opengl
Another composite manager is already running
It appears you might need to disable xfmw4's compositing abilities...
I tried disabling its compositing abilities following these instuctions, but I receive the same message saying that another composite manager is already running.
Hmmm, maybe the instructions are more tailored down to Manjaro's XFCE setup specifically...try disabling "Enable display compositing" under Window Manager Tweaks:
https://forum.xfce.org/viewtopic.php?id=11774
If neither this works, then i'm afraid i'm out of ideas...
User avatar
Termy
Level 12
Level 12
Posts: 4254
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Compton doesn't work correctly after restart

Post by Termy »

So compiz is gone, and xfwm4 isn't using its built-in compositing, but it's still telling you that a compositing manager is running. That's really weird, because I don't think Mint even comes with another compositing manager or window manager with compositing support. I know it comes with marco (or at least I sometimes see it in Mint installations), but I don't think it has built-in compositing.

How about muffin? Can you run ps --noheader -C muffin in a terminal, and tell me if you get any output? Because muffin is a window manager which, it turns out, does also support compositing. xD I think it's just the window manager used in Cinnamon though.

And yeah, those instructions for disabling xfwm4's compositing are applicable here and just about everywhere else.
I'm also Terminalforlife on GitHub.
Mirko

Re: Compton doesn't work correctly after restart

Post by Mirko »

I disabled the compositing abilities setting only Xfwm4 as window manager, without compositing or compton. Sorry, it was very simple.

Xfwm4 keeps the screen tearing at the top of the screen. If I'm not watching videos in full screen I don't even realize it.

But now if I run "compton --vsync opengl" the screen tearing involves the middle of the screen. Very frustrating. If I "Enable display compositing" in Settings > Window Manager Tweaks > Compositor the same happens, screen tearing in the middle of the screen.

But when I move a window (with Xfwm4 without compotising) it is a bit "laggy". The solution is to switch to "Xfwm4 + compton", but I cannot understand why at to boot this doesn't work and I have to change twice in order to make the "Xfwm4 + compton" work.

Thank you for your help and your time, I appreciate that.
User avatar
thx-1138
Level 8
Level 8
Posts: 2092
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Compton doesn't work correctly after restart

Post by thx-1138 »

Mirko wrote:The solution is to switch to "Xfwm4 + compton", but I cannot understand why at to boot this doesn't work and I have to change twice in order to make the "Xfwm4 + compton" work.
On my system, (Mate, not Xfce), i run Marco+Compton in order to have a tear-free experience.
If i fire up System Monitor, and hover the mouse over the processes in question, i see:
marco --no-composite --replace & compton --backend-glx --vsync opengl-swc

Since it all works fine after switching back & forth to Xfwm4 + Compton, it is probably a good idea to check under System Monitor with what extra parameters those 2 are running at that specific point.
Then try to replicate such parameters manually, via start-up commands / tweaking compton.conf etc...
User avatar
Termy
Level 12
Level 12
Posts: 4254
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Compton doesn't work correctly after restart

Post by Termy »

You might want to try out my compton settings. I get an absolutely tear-free experience across the board, and use these settings on various setups, including XFCE:

https://github.com/terminalforlife/misc ... mpton.conf

You will of course want to back up your file before just replacing it with mine, as what works for my setup may not work with yours; I think it's partially hardware dependent. The file is usually processed at: ~/.config/compton.conf You can either copy paste and do it all that way, or run these command to set it all up for you, as well as backing up any currently present file (the first line does that):

Code: Select all

_C="$HOME/.config/compton.conf"; [ -f "$_C" ] && cp "$_C"{,.old}; wget -q "https://raw.githubusercontent.com/terminalforlife/miscellaneous/master/compton.conf" -O "$_C"
If it doesn't work out, restore your old file:

Code: Select all

mv -i $HOME/.config/compton.conf{.old,}
By the way, I've set all that the way I like it, so you may not; it's not the default. I have what I think is a nice fade effect. I don't use shadows because of glitches on some windows (like GNOME Disks), and could never really get it right, so it seemed easier to just do away with shadows. Transparency works fine, as far as I've seen. It does use vsync, and uses the glx backend. I also have my vsync set to 60Hz, so if you're using a different rate, then you'll want to change line 77 to reflect yours.
I'm also Terminalforlife on GitHub.
Mirko

Re: Compton doesn't work correctly after restart

Post by Mirko »

Thank to you I figured out what the problem is! I think it's an important issue of Linux Mint 18.3 XFCE.

At boot Compton starts as compton, checked with System Monitor (gnome-system-monitor). But when I switch back and forth to Xfwm4 + Compton the process changes from simply compton to compton --backend glx --vsync opengl-swc!

I solved the problem by killing Compton at boot and then running it again with its options. I set a little delay of 5 and 10 seconds, just to be sure that everything works fine.
bash -c "sleep 5; killall compton"
bash -c "sleep 10; compton --backend glx --vsync opengl-swc"

Probably also the Termy solution works. The problem is that on my system there isn't any compton.conf file, searched for it. Do I have to create it?

EDIT: Simpler solution is to set only Xfwm4 in Settings > Desktop Settings > Window manager and the run compton --backend glx --vsync opengl-swc at boot.
User avatar
Termy
Level 12
Level 12
Posts: 4254
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Compton doesn't work correctly after restart

Post by Termy »

Nice one! Very good approach. Yeah, the conf file usually isn't generated by default.
I'm also Terminalforlife on GitHub.
Mirko

Re: Compton doesn't work correctly after restart

Post by Mirko »

Termy wrote:Nice one! Very good approach. Yeah, the conf file usually isn't generated by default.
I will test even your idea and I'll update the first post with the solution.

Thank you everyone for your help, what an awesome community here on Linux Mint Forums!
User avatar
Termy
Level 12
Level 12
Posts: 4254
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Compton doesn't work correctly after restart

Post by Termy »

Mirko wrote:
Termy wrote:Nice one! Very good approach. Yeah, the conf file usually isn't generated by default.
I will test even your idea and I'll update the first post with the solution.

Thank you everyone for your help, what an awesome community here on Linux Mint Forums!
:) By the way, apparently you can also place the .conf file directory in ~/, rather than ~/.config/, just in-case that is your preference. If you have any issues with it, just delete the file and it'll not be processed. Also, any settings you've chosen via the command (flags/arguments/option/parameters) will override the .conf file. Oh and you're welcome. I'm liking this community as well. :)
Last edited by Termy on Sun Feb 04, 2018 8:12 pm, edited 1 time in total.
I'm also Terminalforlife on GitHub.
cottfcfan
Level 4
Level 4
Posts: 286
Joined: Tue Jun 16, 2009 7:32 am
Location: Hull, England.

Re: [SOLVED] Compton doesn't work correctly after restart

Post by cottfcfan »

@Termy.
Thanks for sharing your compton.conf configuration. Using it now on my system with intel integrated graphics & it Renders wonderfully.
Just tweaked the fade-delta down from 8 to 6 & added a bit more opacity to the frame & menu.
Thanks again.
User avatar
Termy
Level 12
Level 12
Posts: 4254
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: [SOLVED] Compton doesn't work correctly after restart

Post by Termy »

More than welcome. :) Glad it helped you out.
I'm also Terminalforlife on GitHub.
Locked

Return to “Xfce”