From 2ac308ff6d83f22b85946fb59e2a9b3903203f77 Mon Sep 17 00:00:00 2001
From: Akira Ohgaki <akiraohgaki@gmail.com>
Date: Wed, 28 Jun 2017 11:27:37 +0900
Subject: [PATCH] Apply cursor 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 74b0362..b547e41 100644
--- a/app/src/handlers/systemhandler.cpp
+++ b/app/src/handlers/systemhandler.cpp
@@ -111,7 +111,8 @@ bool SystemHandler::isApplicableType(const QString &installType) const
     }
     else if (desktop == "xfce") {
         applicableTypes << "wallpapers"
-                        << "icons";
+                        << "icons"
+                        << "cursors";
     }
 
     return applicableTypes.contains(installType);
@@ -165,6 +166,9 @@ bool SystemHandler::applyFile(const QString &path, const QString &installType) c
             else if (installType == "icons") {
                 return applyXfceIcon(themeName);
             }
+            else if (installType == "cursors") {
+                return applyXfceCursor(themeName);
+            }
         }
     }
 
@@ -310,4 +314,9 @@ bool SystemHandler::applyXfceIcon(const QString &themeName) const
 {
     return setConfigWithXfconf("xsettings", "/Net/IconThemeName", themeName);
 }
+
+bool SystemHandler::applyXfceCursor(const QString &themeName) const
+{
+    return setConfigWithXfconf("xsettings", "/Gtk/CursorThemeName", themeName);
+}
 #endif
diff --git a/app/src/handlers/systemhandler.h b/app/src/handlers/systemhandler.h
index 87b372a..a392228 100644
--- a/app/src/handlers/systemhandler.h
+++ b/app/src/handlers/systemhandler.h
@@ -40,5 +40,6 @@ private:
     bool setConfigWithXfconf(const QString &channel, const QString &property, const QString &value) const;
     bool applyXfceWallpaper(const QString &path) const;
     bool applyXfceIcon(const QString &themeName) const;
+    bool applyXfceCursor(const QString &themeName) const;
 #endif
 };
-- 
GitLab