diff --git a/helpers/DATA/mate-session-manager/mate-wm b/helpers/DATA/mate-session-manager/mate-wm
index 2b73e4c61bfb138d89f51aff738a9159103164d2..b2d1c00f52ec22a2dc0f476d70b5fb5875513b5e 100755
--- a/helpers/DATA/mate-session-manager/mate-wm
+++ b/helpers/DATA/mate-session-manager/mate-wm
@@ -40,9 +40,22 @@ for n in "$@" ; do
   esac
 done
 
+glxinfo |grep "OpenGL renderer"| grep -vi Gallium | grep -q .
+IS_X_COMPOSITED=$?
+
 # WINDOW_MANAGER overrides all
 if [ -z "$WINDOW_MANAGER" ] ; then
-    WINDOW_MANAGER=`gsettings get org.mate.session.required-components windowmanager 2> /dev/null`
+    WINDOW_MANAGER=`gsettings get org.mate.session.required-components windowmanager 2> /dev/null | sed s/\'//g`
+fi
+
+if [ "x$WINDOW_MANAGER" = "xmarco-compton" ] && [ $IS_X_COMPOSITED != 0 ]; then
+    WINDOW_MANAGER=marco-no-composite
+    gsettings set org.mate.session.required-components windowmanager marco-no-composite
+fi
+
+if [ "x$WINDOW_MANAGER" = "xmarco-compton" ] && [ $IS_X_COMPOSITED = 0 ]; then
+    WINDOW_MANAGER=marco-compton
+    gsettings set org.mate.session.required-components windowmanager marco-compton
 fi
 
 # Migrate compiz to compiz-manager if possible and needed
@@ -69,16 +82,14 @@ if [ -z "$WINDOW_MANAGER" ] ; then
   # compositing ones when it makes sense
 
   KNOWN_WM="sawfish sawmill enlightenment icewm wmaker fvwm2 qvwm fvwm twm kwm"
-  # marco is still the default wm in MATE
-  KNOWN_WM="marco $KNOWN_WM"
 
-  #xdpyinfo 2> /dev/null | grep -q "^ *Composite$" 2> /dev/null
-  glxinfo |grep "OpenGL renderer"| grep -vi Gallium | grep -q .
-  IS_X_COMPOSITED=$?
   if [ $IS_X_COMPOSITED -eq 0 ] ; then
     KNOWN_WM="marco-compton mutter compiz-manager compiz beryl $KNOWN_WM"
   fi
 
+  # marco is still the default wm in MATE
+  KNOWN_WM="marco $KNOWN_WM"
+
   OLDIFS=$IFS
   if [ -z "$DEFWM" -o "x$DEFWM" = "xmate-wm" ]; then
 
diff --git a/helpers/make-mate-session-manager b/helpers/make-mate-session-manager
index ec8e10de49e53f5bd3b8b5f80a2619fffb42abd4..e8df10b3d9b7c6b3cd5bc00c24e5136fb7a9d425 100644
--- a/helpers/make-mate-session-manager
+++ b/helpers/make-mate-session-manager
@@ -17,7 +17,7 @@
 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 #
 
-VERSION=2
+VERSION=3
 
 . ./config