Skip to content

Commit

Permalink
xcursor: move config check to sync gsettings (#9473)
Browse files Browse the repository at this point in the history
move the check down into the function itself, 39df1f4 began syncing on
session change, but isnt checking for the setting itself, so instead of
duplicating checks all over. do it here.
  • Loading branch information
gulafaran authored Feb 23, 2025
1 parent f4b148d commit 8f50460
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/managers/XCursorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ void CXCursorManager::loadTheme(std::string const& name, int size, float scale)
cursors.emplace_back(cursor);
}

static auto SYNCGSETTINGS = CConfigValue<Hyprlang::INT>("cursor:sync_gsettings_theme");
if (*SYNCGSETTINGS)
syncGsettings();
syncGsettings();
}

SP<SXCursors> CXCursorManager::getShape(std::string const& shape, int size, float scale) {
Expand Down Expand Up @@ -560,6 +558,10 @@ std::vector<SP<SXCursors>> CXCursorManager::loadAllFromDir(std::string const& pa
}

void CXCursorManager::syncGsettings() {
static auto SYNCGSETTINGS = CConfigValue<Hyprlang::INT>("cursor:sync_gsettings_theme");
if (!*SYNCGSETTINGS)
return;

auto checkParamExists = [](std::string const& paramName, std::string const& category) {
auto* gSettingsSchemaSource = g_settings_schema_source_get_default();

Expand Down

0 comments on commit 8f50460

Please sign in to comment.