From 39df1f4dbfedf97a7f30f9de359f3b3415844380 Mon Sep 17 00:00:00 2001 From: Ikalco <73481042+ikalco@users.noreply.github.com> Date: Tue, 13 Aug 2024 12:27:00 -0500 Subject: [PATCH] cursormgr: fix cursor gsettings on session change (#7295) --- src/Compositor.cpp | 1 + src/managers/CursorManager.cpp | 6 +++++- src/managers/CursorManager.hpp | 3 ++- src/managers/XCursorManager.cpp | 1 + src/managers/XCursorManager.hpp | 4 ++-- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index a2f7c52a388..26a985ef144 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -393,6 +393,7 @@ void CCompositor::initAllSignals() { } g_pConfigManager->m_bWantsMonitorReload = true; + g_pCursorManager->syncGsettings(); } else { Debug::log(LOG, "Session got deactivated!"); diff --git a/src/managers/CursorManager.cpp b/src/managers/CursorManager.cpp index 3f3a25f6f4e..e2dd5bb3eb1 100644 --- a/src/managers/CursorManager.cpp +++ b/src/managers/CursorManager.cpp @@ -337,4 +337,8 @@ bool CCursorManager::changeTheme(const std::string& name, const int size) { updateTheme(); return true; -} \ No newline at end of file +} + +void CCursorManager::syncGsettings() { + m_pXcursor->syncGsettings(); +} diff --git a/src/managers/CursorManager.hpp b/src/managers/CursorManager.hpp index ceb4816baf3..796ab10e75b 100644 --- a/src/managers/CursorManager.hpp +++ b/src/managers/CursorManager.hpp @@ -53,6 +53,7 @@ class CCursorManager { void updateTheme(); SCursorImageData dataFor(const std::string& name); // for xwayland void setXWaylandCursor(); + void syncGsettings(); void tickAnimatedCursor(); @@ -75,4 +76,4 @@ class CCursorManager { Hyprcursor::SCursorShapeData m_sCurrentCursorShapeData; }; -inline std::unique_ptr g_pCursorManager; \ No newline at end of file +inline std::unique_ptr g_pCursorManager; diff --git a/src/managers/XCursorManager.cpp b/src/managers/XCursorManager.cpp index 1108bbb20e6..3d36add585a 100644 --- a/src/managers/XCursorManager.cpp +++ b/src/managers/XCursorManager.cpp @@ -5,6 +5,7 @@ #include #include "config/ConfigValue.hpp" #include "helpers/CursorShapes.hpp" +#include "../managers/CursorManager.hpp" #include "debug/Log.hpp" #include "XCursorManager.hpp" diff --git a/src/managers/XCursorManager.hpp b/src/managers/XCursorManager.hpp index 464c1ec3fe8..48fda5dd4ee 100644 --- a/src/managers/XCursorManager.hpp +++ b/src/managers/XCursorManager.hpp @@ -31,6 +31,7 @@ class CXCursorManager { void loadTheme(const std::string& name, int size); SP getShape(std::string const& shape, int size); + void syncGsettings(); private: SP createCursor(std::string const& shape, XcursorImages* xImages); @@ -38,11 +39,10 @@ class CXCursorManager { std::string getLegacyShapeName(std::string const& shape); std::vector> loadStandardCursors(std::string const& name, int size); std::vector> loadAllFromDir(std::string const& path, int size); - void syncGsettings(); int lastLoadSize = 0; std::string themeName = ""; SP defaultCursor; SP hyprCursor; std::vector> cursors; -}; \ No newline at end of file +};