diff --git a/CHANGELOG.md b/CHANGELOG.md index 2546d975f..1cd3246ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 2.1.2 + +Bugfixes: +* Fix icon detection on Windows. It shows enabled system icons in desktop (`This PC`, `Recycle Bin`, etc) (Icon, Windows) +* Fix compatibility with ddcutil 2.0 (Brightness, Linux) +* Fix a compile warning (CPUUsage, FreeBSD) + # 2.1.1 Features: diff --git a/CMakeLists.txt b/CMakeLists.txt index 91b13df6c..f883df03d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url project(fastfetch - VERSION 2.1.1 + VERSION 2.1.2 LANGUAGES C DESCRIPTION "Fast system information tool" HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch" diff --git a/src/detection/brightness/brightness_linux.c b/src/detection/brightness/brightness_linux.c index 85713f225..9b354c0f2 100644 --- a/src/detection/brightness/brightness_linux.c +++ b/src/detection/brightness/brightness_linux.c @@ -90,8 +90,14 @@ static const char* detectWithBacklight(FFlist* result) #include "common/library.h" #include "util/mallocHelper.h" +#include #include +// Try to be compatible with ddcutil 2.0 +#if DDCUTIL_VMAJOR >= 2 +double ddca_set_default_sleep_multiplier(double multiplier); // ddcutil 1.4 +#endif + static const char* detectWithDdcci(FFBrightnessOptions* options, FFlist* result) { FF_LIBRARY_LOAD(libddcutil, &instance.config.libDdcutil, "dlopen ddcutil failed", "libddcutil" FF_LIBRARY_EXTENSION, 5); @@ -100,13 +106,15 @@ static const char* detectWithDdcci(FFBrightnessOptions* options, FFlist* result) FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libddcutil, ddca_get_any_vcp_value_using_explicit_type) FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libddcutil, ddca_free_any_vcp_value) FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libddcutil, ddca_close_display) - FF_LIBRARY_LOAD_SYMBOL_MESSAGE(libddcutil, ddca_set_default_sleep_multiplier) + + __typeof__(&ddca_set_default_sleep_multiplier) ffddca_set_default_sleep_multiplier = dlsym(libddcutil, "ddca_set_default_sleep_multiplier"); + if (ffddca_set_default_sleep_multiplier) + ffddca_set_default_sleep_multiplier(options->ddcciSleep / 40.0); + libddcutil = NULL; // Don't dlclose libddcutil. See https://github.com/rockowitz/ddcutil/issues/330 - ffddca_set_default_sleep_multiplier(options->ddcciSleep / 40.0); - FF_AUTO_FREE DDCA_Display_Info_List* infoList = NULL; - if (__builtin_expect(ffddca_get_display_info_list2(false, &infoList) < 0, 0)) + if (ffddca_get_display_info_list2(false, &infoList) < 0) return "ddca_get_display_info_list2(false, &infoList) failed"; if (infoList->ct == 0) diff --git a/src/detection/cpuusage/cpuusage_bsd.c b/src/detection/cpuusage/cpuusage_bsd.c index 6c58832e0..87c6757a7 100644 --- a/src/detection/cpuusage/cpuusage_bsd.c +++ b/src/detection/cpuusage/cpuusage_bsd.c @@ -12,7 +12,7 @@ const char* ffGetCpuUsageInfo(FFlist* cpuTimes) if(sysctlbyname("kern.cp_times", NULL, &neededLength, NULL, 0) != 0) return "sysctlbyname(kern.cp_times, NULL) failed"; - uint32_t coreCount = neededLength / (CPUSTATES * (uint32_t) sizeof(uint64_t)); + uint32_t coreCount = (uint32_t) (neededLength / (CPUSTATES * sizeof(uint64_t))); assert(coreCount > 0); FF_AUTO_FREE uint64_t (*cpTimes)[CPUSTATES] = malloc(neededLength); diff --git a/src/detection/icons/icons_windows.c b/src/detection/icons/icons_windows.c index 0008d04af..894e34465 100644 --- a/src/detection/icons/icons_windows.c +++ b/src/detection/icons/icons_windows.c @@ -4,11 +4,12 @@ const char* ffDetectIcons(FFstrbuf* result) { FF_HKEY_AUTO_DESTROY hKey = NULL; - if(!ffRegOpenKeyForRead(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu", &hKey, NULL)) - return "ffRegOpenKeyForRead(Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu) failed"; + if(!ffRegOpenKeyForRead(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel", &hKey, NULL) && + !ffRegOpenKeyForRead(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu", &hKey, NULL)) + return "ffRegOpenKeyForRead(Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\{NewStartPanel|ClassicStartMenu}) failed"; // Whether these icons are hidden - uint32_t ThisPC = 0, UsersFiles = 0, RemoteNetwork = 0, RecycleBin = 0, ControlPanel = 0; + uint32_t ThisPC = 1, UsersFiles = 1, RemoteNetwork = 1, RecycleBin = 0 /* Shown by default */, ControlPanel = 1; ffRegReadUint(hKey, L"{20D04FE0-3AEA-1069-A2D8-08002B30309D}", &ThisPC, NULL); ffRegReadUint(hKey, L"{59031a47-3f72-44a7-89c5-5595fe6b30ee}", &UsersFiles, NULL); ffRegReadUint(hKey, L"{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}", &RemoteNetwork, NULL);