From c61b4ba16f2a80c14eac95d20abaaa18aa4746f9 Mon Sep 17 00:00:00 2001
From: Akira Ohgaki <akiraohgaki@gmail.com>
Date: Wed, 28 Jun 2017 11:43:20 +0900
Subject: [PATCH] Apply xfwm4 theme with xfce

---
 app/src/handlers/systemhandler.cpp | 11 ++++++++++-
 app/src/handlers/systemhandler.h   |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/app/src/handlers/systemhandler.cpp b/app/src/handlers/systemhandler.cpp
index 6ea5ad7..dc4b823 100644
--- a/app/src/handlers/systemhandler.cpp
+++ b/app/src/handlers/systemhandler.cpp
@@ -113,7 +113,8 @@ bool SystemHandler::isApplicableType(const QString &installType) const
         applicableTypes << "wallpapers"
                         << "icons"
                         << "cursors"
-                        << "gtk3_themes";
+                        << "gtk3_themes"
+                        << "xfwm4_themes";
     }
 
     return applicableTypes.contains(installType);
@@ -173,6 +174,9 @@ bool SystemHandler::applyFile(const QString &path, const QString &installType) c
             else if (installType == "gtk3_themes") {
                 return applyXfceGtk3Theme(themeName);
             }
+            else if (installType == "xfwm4_themes") {
+                return applyXfceXfwm4Theme(themeName);
+            }
         }
     }
 
@@ -328,4 +332,9 @@ bool SystemHandler::applyXfceGtk3Theme(const QString &themeName) const
 {
     return setConfigWithXfconf("xsettings", "/Net/ThemeName", themeName);
 }
+
+bool SystemHandler::applyXfceXfwm4Theme(const QString &themeName) const
+{
+    return setConfigWithXfconf("xfwm4", "/general/theme", themeName);
+}
 #endif
diff --git a/app/src/handlers/systemhandler.h b/app/src/handlers/systemhandler.h
index 918e58d..9b80705 100644
--- a/app/src/handlers/systemhandler.h
+++ b/app/src/handlers/systemhandler.h
@@ -42,5 +42,6 @@ private:
     bool applyXfceIcon(const QString &themeName) const;
     bool applyXfceCursor(const QString &themeName) const;
     bool applyXfceGtk3Theme(const QString &themeName) const;
+    bool applyXfceXfwm4Theme(const QString &themeName) const;
 #endif
 };
-- 
GitLab