Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cursor gsettings on session change #7295

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ void CCompositor::initAllSignals() {
}

g_pConfigManager->m_bWantsMonitorReload = true;
g_pCursorManager->syncGsettings();
} else {
Debug::log(LOG, "Session got deactivated!");

Expand Down
6 changes: 5 additions & 1 deletion src/managers/CursorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,4 +337,8 @@ bool CCursorManager::changeTheme(const std::string& name, const int size) {
updateTheme();

return true;
}
}

void CCursorManager::syncGsettings() {
m_pXcursor->syncGsettings();
}
3 changes: 2 additions & 1 deletion src/managers/CursorManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class CCursorManager {
void updateTheme();
SCursorImageData dataFor(const std::string& name); // for xwayland
void setXWaylandCursor();
void syncGsettings();

void tickAnimatedCursor();

Expand All @@ -75,4 +76,4 @@ class CCursorManager {
Hyprcursor::SCursorShapeData m_sCurrentCursorShapeData;
};

inline std::unique_ptr<CCursorManager> g_pCursorManager;
inline std::unique_ptr<CCursorManager> g_pCursorManager;
1 change: 1 addition & 0 deletions src/managers/XCursorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <gio/gsettingsschema.h>
#include "config/ConfigValue.hpp"
#include "helpers/CursorShapes.hpp"
#include "../managers/CursorManager.hpp"
#include "debug/Log.hpp"
#include "XCursorManager.hpp"

Expand Down
4 changes: 2 additions & 2 deletions src/managers/XCursorManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ class CXCursorManager {

void loadTheme(const std::string& name, int size);
SP<SXCursors> getShape(std::string const& shape, int size);
void syncGsettings();

private:
SP<SXCursors> createCursor(std::string const& shape, XcursorImages* xImages);
std::unordered_set<std::string> themePaths(std::string const& theme);
std::string getLegacyShapeName(std::string const& shape);
std::vector<SP<SXCursors>> loadStandardCursors(std::string const& name, int size);
std::vector<SP<SXCursors>> loadAllFromDir(std::string const& path, int size);
void syncGsettings();

int lastLoadSize = 0;
std::string themeName = "";
SP<SXCursors> defaultCursor;
SP<SXCursors> hyprCursor;
std::vector<SP<SXCursors>> cursors;
};
};
Loading