From 71d461266e6777e1e0a0dde099441ac6691f6a91 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Mon, 12 Jan 2026 18:19:21 +0800 Subject: [PATCH 01/14] Packaging: updates debian stuff [ci skip] --- debian/changelog.tpl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog.tpl b/debian/changelog.tpl index 7a95ddefaf..c6a75212b1 100644 --- a/debian/changelog.tpl +++ b/debian/changelog.tpl @@ -1,3 +1,9 @@ +fastfetch (2.57.0~#UBUNTU_CODENAME#) #UBUNTU_CODENAME#; urgency=medium + + * Update to 2.57.0 + + -- Carter Li Mon, 12 Jan 2026 10:11:21 +0800 + fastfetch (2.56.1~#UBUNTU_CODENAME#) #UBUNTU_CODENAME#; urgency=medium * Update to 2.56.1 From af075b8ef835d786953dcbbb61f3d7be19d38af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 12 Jan 2026 10:50:46 +0800 Subject: [PATCH 02/14] Github: update `logo_request.yml` [ci skip] --- .github/ISSUE_TEMPLATE/logo_request.yml | 27 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/logo_request.yml b/.github/ISSUE_TEMPLATE/logo_request.yml index 9790eef5d6..fa0570dab3 100644 --- a/.github/ISSUE_TEMPLATE/logo_request.yml +++ b/.github/ISSUE_TEMPLATE/logo_request.yml @@ -6,35 +6,42 @@ body: - type: markdown attributes: value: | - Tip: A logo can be displayed by fastfetch without getting into fastfetch's official repo. - For highly customized logo for personal use, it's recommended to keep it locally. + Tip: You can display a logo in fastfetch without adding it to fastfetch's official repo. + For highly customized, personal logos, we recommend keeping them locally. Please refer to https://github.com/fastfetch-cli/fastfetch/wiki/Migrate-Neofetch-Logo-To-Fastfetch - type: textarea attributes: label: OS - description: Paste content of `/etc/os-release` and `/etc/lsb-release` here. If none of these files exist, describe a way to identify the distro + description: Paste the contents of `/etc/os-release` and `/etc/lsb-release` here. If neither file exists, describe how to identify the distro. placeholder: cat /etc/os-release validations: required: true + - type: input + attributes: + label: Distro Website + description: To help prevent spam and verify the request, a distro website is required, and a downloadable ISO must be available on that site. + placeholder: https://example.com + validations: + required: true - type: textarea attributes: label: ASCII Art - description: An ASCII logo should not take up too much space (smaller than 50x20 characters). Please also include the color codes if not available in `os-release` + description: The ASCII logo should not take up too much space (smaller than 50x20 characters, W x H). Please also include the color codes if they are not available in `os-release`. placeholder: Paste ASCII art here validations: required: true - type: input attributes: - label: Original Image - description: If the ASCII art is based on an image, please provide a link to the original image - placeholder: Image URL or distro website URL + label: Original Image URL + description: If the ASCII art is based on an image, please provide a link to the original image file. + placeholder: Image URL from the distro website mentioned above - type: checkboxes attributes: label: Checklist options: - - label: The ASCII art is smaller than 50x20 characters (width x height) + - label: The ASCII art is smaller than 50x20 characters (W x H). required: true - - label: The ASCII art contains color codes, or the color codes are available in `os-release` + - label: The ASCII art includes color codes, or the color codes are available in `os-release`. required: true - - label: The ASCII art contains no internal paddings (spaces at the start and the end of lines) + - label: The ASCII art has no internal padding (spaces at the start and/or end of lines). required: true From fd3c87abe7a5851bff29be38a0e91e92a3e87cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 12 Jan 2026 11:03:49 +0800 Subject: [PATCH 03/14] Github: adds pull_request_template.md [ci skip] --- .github/pull_request_template.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..d99cb91ff0 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,26 @@ +## Summary + + + +## Related issue (required for new logos for new distros) + + + +Closes # + +## Changes + +- + +## Checklist + +- [ ] I have tested my changes locally. From 2f1e37bb7cad2284f52dcef1377e9eebbabc35d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 12 Jan 2026 14:29:49 +0800 Subject: [PATCH 04/14] Common (Windows): improves performance of `ffTimeGetTick` --- src/common/impl/time.c | 4 ++++ src/common/time.h | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/common/impl/time.c b/src/common/impl/time.c index b49dd0aeee..40bd9b6ffc 100644 --- a/src/common/impl/time.c +++ b/src/common/impl/time.c @@ -81,3 +81,7 @@ FFTimeGetAgeResult ffTimeGetAge(uint64_t birthMs, uint64_t nowMs) return result; } + +#ifdef _WIN32 + double ffQpcMultiplier; +#endif diff --git a/src/common/time.h b/src/common/time.h index cdb345d3c8..867980f12b 100644 --- a/src/common/time.h +++ b/src/common/time.h @@ -15,11 +15,16 @@ static inline double ffTimeGetTick(void) //In msec { #ifdef _WIN32 - LARGE_INTEGER frequency; - QueryPerformanceFrequency(&frequency); + extern double ffQpcMultiplier; + if (ffQpcMultiplier == 0) + { + LARGE_INTEGER frequency; + QueryPerformanceFrequency(&frequency); + ffQpcMultiplier = 1000. / (double) frequency.QuadPart; + } LARGE_INTEGER start; QueryPerformanceCounter(&start); - return (double) start.QuadPart * 1000 / (double) frequency.QuadPart; + return (double) start.QuadPart * ffQpcMultiplier; #elif defined(__HAIKU__) return (double) system_time() / 1000.; #else From 1c066bc69ab79b73896c784179956260f8ee3500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 12 Jan 2026 15:10:16 +0800 Subject: [PATCH 05/14] Common: updates `ffTimeSleep` to return `true` on success --- src/common/time.h | 20 ++++++++++++++++---- src/common/windows/nt.h | 22 +++++++++++----------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/common/time.h b/src/common/time.h index 867980f12b..de32bb8430 100644 --- a/src/common/time.h +++ b/src/common/time.h @@ -1,11 +1,20 @@ #pragma once +#include #include #include #ifdef _WIN32 - #include + #include + #include #include #include + + NTSYSCALLAPI + NTSTATUS + NTAPI + NtDelayExecution( + _In_ BOOLEAN Alertable, + _In_ PLARGE_INTEGER DelayInterval); #elif defined(__HAIKU__) #include #endif @@ -49,12 +58,15 @@ static inline uint64_t ffTimeGetNow(void) #endif } -static inline void ffTimeSleep(uint32_t msec) +// Returns true if not interrupted +static inline bool ffTimeSleep(uint32_t msec) { #ifdef _WIN32 - SleepEx(msec, TRUE); + LARGE_INTEGER interval; + interval.QuadPart = -(int64_t) msec * 10000; // Relative time in 100-nanosecond intervals + return NtDelayExecution(TRUE, &interval) == STATUS_SUCCESS; #else - nanosleep(&(struct timespec){ msec / 1000, (long) (msec % 1000) * 1000000 }, NULL); + return nanosleep(&(struct timespec){ msec / 1000, (long) (msec % 1000) * 1000000 }, NULL) == 0; #endif } diff --git a/src/common/windows/nt.h b/src/common/windows/nt.h index 8d6af4b7e2..2110836ab3 100644 --- a/src/common/windows/nt.h +++ b/src/common/windows/nt.h @@ -237,14 +237,14 @@ NTSYSCALLAPI NTSTATUS NTAPI NtQueryDirectoryFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass, - IN BOOLEAN ReturnSingleEntry, - IN PUNICODE_STRING FileName OPTIONAL, - IN BOOLEAN RestartScan); + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FileInformation, + IN ULONG Length, + IN FILE_INFORMATION_CLASS FileInformationClass, + IN BOOLEAN ReturnSingleEntry, + IN PUNICODE_STRING FileName OPTIONAL, + IN BOOLEAN RestartScan); From 6496dcd7d05da1e851830a416370a01268f7c245 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Tue, 13 Jan 2026 09:24:27 +0800 Subject: [PATCH 06/14] DisplayServer (Linux): refactors property handling in xcb and xlib --- src/detection/displayserver/linux/xcb.c | 128 ++++++++++------------- src/detection/displayserver/linux/xlib.c | 80 ++++++-------- 2 files changed, 86 insertions(+), 122 deletions(-) diff --git a/src/detection/displayserver/linux/xcb.c b/src/detection/displayserver/linux/xcb.c index 3cc8a9953f..7d24448b54 100644 --- a/src/detection/displayserver/linux/xcb.c +++ b/src/detection/displayserver/linux/xcb.c @@ -13,8 +13,28 @@ #include #include -typedef struct XcbPropertyData +typedef struct XcbRandrData { + FF_LIBRARY_SYMBOL(xcb_randr_get_screen_resources_current) + FF_LIBRARY_SYMBOL(xcb_randr_get_screen_resources_current_reply) + FF_LIBRARY_SYMBOL(xcb_randr_get_screen_resources_current_modes_iterator) + FF_LIBRARY_SYMBOL(xcb_randr_mode_info_next) + FF_LIBRARY_SYMBOL(xcb_randr_get_monitors) + FF_LIBRARY_SYMBOL(xcb_randr_get_monitors_reply) + FF_LIBRARY_SYMBOL(xcb_randr_get_monitors_monitors_iterator) + FF_LIBRARY_SYMBOL(xcb_randr_monitor_info_next) + FF_LIBRARY_SYMBOL(xcb_randr_monitor_info_outputs_length) + FF_LIBRARY_SYMBOL(xcb_randr_monitor_info_outputs) + FF_LIBRARY_SYMBOL(xcb_randr_output_next) + FF_LIBRARY_SYMBOL(xcb_randr_get_output_info) + FF_LIBRARY_SYMBOL(xcb_randr_get_output_info_reply) + FF_LIBRARY_SYMBOL(xcb_randr_get_crtc_info) + FF_LIBRARY_SYMBOL(xcb_randr_get_crtc_info_reply) + FF_LIBRARY_SYMBOL(xcb_randr_get_output_property) + FF_LIBRARY_SYMBOL(xcb_randr_get_output_property_reply) + FF_LIBRARY_SYMBOL(xcb_randr_get_output_property_data) + FF_LIBRARY_SYMBOL(xcb_randr_get_output_property_data_length) + FF_LIBRARY_SYMBOL(xcb_intern_atom) FF_LIBRARY_SYMBOL(xcb_intern_atom_reply) FF_LIBRARY_SYMBOL(xcb_get_property) @@ -28,37 +48,21 @@ typedef struct XcbPropertyData FF_LIBRARY_SYMBOL(xcb_get_setup) FF_LIBRARY_SYMBOL(xcb_setup_vendor) FF_LIBRARY_SYMBOL(xcb_setup_vendor_length) -} XcbPropertyData; -static bool xcbInitPropertyData(FF_MAYBE_UNUSED void* libraryHandle, XcbPropertyData* propertyData) -{ - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_intern_atom, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_intern_atom_reply, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_get_property, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_get_property_reply, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_get_property_value, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_get_property_value_length, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_get_atom_name, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_get_atom_name_name, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_get_atom_name_name_length, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_get_atom_name_reply, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_get_setup, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_setup_vendor, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, xcb_setup_vendor_length, false) - - return true; -} + //init once + xcb_connection_t* connection; + FFDisplayServerResult* result; +} XcbRandrData; -static void* xcbGetProperty(XcbPropertyData* data, xcb_connection_t* connection, xcb_window_t window, const char* request) +static void* xcbGetProperty(XcbRandrData* data, xcb_window_t window, const char* request) { - xcb_intern_atom_cookie_t requestAtomCookie = data->ffxcb_intern_atom(connection, true, (uint16_t) strlen(request), request); - FF_AUTO_FREE xcb_intern_atom_reply_t* requestAtomReply = data->ffxcb_intern_atom_reply(connection, requestAtomCookie, NULL); + xcb_intern_atom_cookie_t requestAtomCookie = data->ffxcb_intern_atom(data->connection, true, (uint16_t) strlen(request), request); + FF_AUTO_FREE xcb_intern_atom_reply_t* requestAtomReply = data->ffxcb_intern_atom_reply(data->connection, requestAtomCookie, NULL); if(requestAtomReply == NULL) return NULL; - xcb_get_property_cookie_t propertyCookie = data->ffxcb_get_property(connection, false, window, requestAtomReply->atom, XCB_ATOM_ANY, 0, 8 * 1024); - - FF_AUTO_FREE xcb_get_property_reply_t* propertyReply = data->ffxcb_get_property_reply(connection, propertyCookie, NULL); + xcb_get_property_cookie_t propertyCookie = data->ffxcb_get_property(data->connection, false, window, requestAtomReply->atom, XCB_ATOM_ANY, 0, 8 * 1024); + FF_AUTO_FREE xcb_get_property_reply_t* propertyReply = data->ffxcb_get_property_reply(data->connection, propertyCookie, NULL); if(propertyReply == NULL) return NULL; @@ -74,18 +78,18 @@ static void* xcbGetProperty(XcbPropertyData* data, xcb_connection_t* connection, return replyValue; } -static void xcbDetectWMfromEWMH(XcbPropertyData* data, xcb_connection_t* connection, xcb_window_t rootWindow, FFDisplayServerResult* result) +static void xcbDetectWMfromEWMH(XcbRandrData* data, xcb_window_t rootWindow, FFDisplayServerResult* result) { if(result->wmProcessName.length > 0 || ffStrbufCompS(&result->wmProtocolName, FF_WM_PROTOCOL_WAYLAND) == 0) return; - FF_AUTO_FREE xcb_window_t* wmWindow = (xcb_window_t*) xcbGetProperty(data, connection, rootWindow, "_NET_SUPPORTING_WM_CHECK"); + FF_AUTO_FREE xcb_window_t* wmWindow = (xcb_window_t*) xcbGetProperty(data, rootWindow, "_NET_SUPPORTING_WM_CHECK"); if(wmWindow == NULL) return; - FF_AUTO_FREE char* wmName = (char*) xcbGetProperty(data, connection, *wmWindow, "WM_NAME"); + FF_AUTO_FREE char* wmName = (char*) xcbGetProperty(data, *wmWindow, "WM_NAME"); if(!ffStrSet(wmName)) - wmName = (char*) xcbGetProperty(data, connection, *wmWindow, "_NET_WM_NAME"); + wmName = (char*) xcbGetProperty(data, *wmWindow, "_NET_WM_NAME"); if(!ffStrSet(wmName)) return; @@ -93,9 +97,9 @@ static void xcbDetectWMfromEWMH(XcbPropertyData* data, xcb_connection_t* connect ffStrbufSetS(&result->wmProcessName, wmName); } -static void xcbFetchServerVendor(XcbPropertyData* data, xcb_connection_t* connection, FFDisplayServerResult* result) +static void xcbFetchServerVendor(XcbRandrData* data, FFDisplayServerResult* result) { - const xcb_setup_t* setup = data->ffxcb_get_setup(connection); + const xcb_setup_t* setup = data->ffxcb_get_setup(data->connection); int length = data->ffxcb_setup_vendor_length(setup); if(length <= 0) @@ -110,36 +114,6 @@ static void xcbFetchServerVendor(XcbPropertyData* data, xcb_connection_t* connec } } -typedef struct XcbRandrData -{ - FF_LIBRARY_SYMBOL(xcb_randr_get_screen_resources_current) - FF_LIBRARY_SYMBOL(xcb_randr_get_screen_resources_current_reply) - FF_LIBRARY_SYMBOL(xcb_randr_get_screen_resources_current_modes_iterator) - FF_LIBRARY_SYMBOL(xcb_randr_mode_info_next) - FF_LIBRARY_SYMBOL(xcb_randr_get_monitors) - FF_LIBRARY_SYMBOL(xcb_randr_get_monitors_reply) - FF_LIBRARY_SYMBOL(xcb_randr_get_monitors_monitors_iterator) - FF_LIBRARY_SYMBOL(xcb_randr_monitor_info_next) - FF_LIBRARY_SYMBOL(xcb_randr_monitor_info_outputs_length) - FF_LIBRARY_SYMBOL(xcb_randr_monitor_info_outputs) - FF_LIBRARY_SYMBOL(xcb_randr_output_next) - FF_LIBRARY_SYMBOL(xcb_randr_get_output_info) - FF_LIBRARY_SYMBOL(xcb_randr_get_output_info_reply) - FF_LIBRARY_SYMBOL(xcb_randr_get_crtc_info) - FF_LIBRARY_SYMBOL(xcb_randr_get_crtc_info_reply) - FF_LIBRARY_SYMBOL(xcb_randr_get_output_property) - FF_LIBRARY_SYMBOL(xcb_randr_get_output_property_reply) - FF_LIBRARY_SYMBOL(xcb_randr_get_output_property_data) - FF_LIBRARY_SYMBOL(xcb_randr_get_output_property_data_length) - FF_LIBRARY_SYMBOL(xcb_intern_atom) - FF_LIBRARY_SYMBOL(xcb_intern_atom_reply) - - //init once - xcb_connection_t* connection; - FFDisplayServerResult* result; - XcbPropertyData propData; -} XcbRandrData; - static bool xcbRandrHandleOutput(XcbRandrData* data, xcb_randr_output_t output, FFstrbuf* name, bool primary, FFDisplayType displayType, struct xcb_randr_get_screen_resources_current_reply_t* screenResources, uint8_t bitDepth, double scaleFactor) { xcb_randr_get_output_info_cookie_t outputInfoCookie = data->ffxcb_randr_get_output_info(data->connection, output, XCB_CURRENT_TIME); @@ -251,14 +225,14 @@ static bool xcbRandrHandleMonitor(XcbRandrData* data, xcb_randr_monitor_info_t* .rem = data->ffxcb_randr_monitor_info_outputs_length(monitor) }; - FF_AUTO_FREE xcb_get_atom_name_reply_t* nameReply = data->propData.ffxcb_get_atom_name_reply( + FF_AUTO_FREE xcb_get_atom_name_reply_t* nameReply = data->ffxcb_get_atom_name_reply( data->connection, - data->propData.ffxcb_get_atom_name(data->connection, monitor->name), + data->ffxcb_get_atom_name(data->connection, monitor->name), NULL ); FF_STRBUF_AUTO_DESTROY name = ffStrbufCreateNS( - (uint32_t) data->propData.ffxcb_get_atom_name_name_length(nameReply), - data->propData.ffxcb_get_atom_name_name(nameReply) + (uint32_t) data->ffxcb_get_atom_name_name_length(nameReply), + data->ffxcb_get_atom_name_name(nameReply) ); const FFDisplayType displayType = ffdsGetDisplayType(name.chars); @@ -306,7 +280,7 @@ static bool xcbRandrHandleMonitors(XcbRandrData* data, xcb_screen_t* screen) FF_AUTO_FREE struct xcb_randr_get_screen_resources_current_reply_t* screenResources = data->ffxcb_randr_get_screen_resources_current_reply(data->connection, screenResourcesCookie, NULL); double scaleFactor = 1; - FF_AUTO_FREE const char* resourceManager = xcbGetProperty(&data->propData, data->connection, screen->root, "RESOURCE_MANAGER"); + FF_AUTO_FREE const char* resourceManager = xcbGetProperty(data, screen->root, "RESOURCE_MANAGER"); if (resourceManager) { FF_STRBUF_AUTO_DESTROY dpi = ffStrbufCreate(); @@ -369,6 +343,18 @@ const char* ffdsConnectXcbRandr(FFDisplayServerResult* result) FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_intern_atom) FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_intern_atom_reply) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_get_property) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_get_property_reply) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_get_property_value) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_get_property_value_length) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_get_atom_name) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_get_atom_name_name) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_get_atom_name_name_length) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_get_atom_name_reply) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_get_setup) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_setup_vendor) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_setup_vendor_length) + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_randr_get_screen_resources_current) FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_randr_get_screen_resources_current_reply) FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_randr_get_screen_resources_current_modes_iterator) @@ -389,8 +375,6 @@ const char* ffdsConnectXcbRandr(FFDisplayServerResult* result) FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_randr_get_crtc_info) FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_randr_get_crtc_info_reply) - bool propertyDataInitialized = xcbInitPropertyData(xcbRandr, &data.propData); - data.connection = ffxcb_connect(NULL, NULL); if(ffxcb_connection_has_error(data.connection) > 0) @@ -405,9 +389,9 @@ const char* ffdsConnectXcbRandr(FFDisplayServerResult* result) xcb_screen_iterator_t iterator = ffxcb_setup_roots_iterator(ffxcb_get_setup(data.connection)); - if(iterator.rem > 0 && propertyDataInitialized) { - xcbDetectWMfromEWMH(&data.propData, data.connection, iterator.data->root, result); - xcbFetchServerVendor(&data.propData, data.connection, result); + if(iterator.rem > 0) { + xcbDetectWMfromEWMH(&data, iterator.data->root, result); + xcbFetchServerVendor(&data, result); } diff --git a/src/detection/displayserver/linux/xlib.c b/src/detection/displayserver/linux/xlib.c index 6dd06bf175..9490b040dc 100644 --- a/src/detection/displayserver/linux/xlib.c +++ b/src/detection/displayserver/linux/xlib.c @@ -10,25 +10,29 @@ #include #include -typedef struct X11PropertyData +typedef struct XrandrData { FF_LIBRARY_SYMBOL(XInternAtom) + FF_LIBRARY_SYMBOL(XGetAtomName); FF_LIBRARY_SYMBOL(XGetWindowProperty) FF_LIBRARY_SYMBOL(XServerVendor) - FF_LIBRARY_SYMBOL(XFree) -} X11PropertyData; - -static bool x11InitPropertyData(FF_MAYBE_UNUSED void* libraryHandle, X11PropertyData* propertyData) -{ - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, XInternAtom, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, XGetWindowProperty, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, XServerVendor, false) - FF_LIBRARY_LOAD_SYMBOL_PTR(libraryHandle, propertyData, XFree, false) + FF_LIBRARY_SYMBOL(XFree); + FF_LIBRARY_SYMBOL(XRRGetMonitors) + FF_LIBRARY_SYMBOL(XRRGetScreenResourcesCurrent) + FF_LIBRARY_SYMBOL(XRRGetOutputInfo) + FF_LIBRARY_SYMBOL(XRRGetOutputProperty) + FF_LIBRARY_SYMBOL(XRRGetCrtcInfo) + FF_LIBRARY_SYMBOL(XRRFreeCrtcInfo) + FF_LIBRARY_SYMBOL(XRRFreeOutputInfo) + FF_LIBRARY_SYMBOL(XRRFreeScreenResources) + FF_LIBRARY_SYMBOL(XRRFreeMonitors) - return true; -} + //Init once + Display* display; + FFDisplayServerResult* result; +} XrandrData; -static unsigned char* x11GetProperty(X11PropertyData* data, Display* display, Window window, const char* request) +static unsigned char* x11GetProperty(XrandrData* data, Display* display, Window window, const char* request) { Atom requestAtom = data->ffXInternAtom(display, request, False); if(requestAtom == None) @@ -44,18 +48,18 @@ static unsigned char* x11GetProperty(X11PropertyData* data, Display* display, Wi return result; } -static void x11DetectWMFromEWMH(X11PropertyData* data, Display* display, FFDisplayServerResult* result) +static void x11DetectWMFromEWMH(XrandrData* data, FFDisplayServerResult* result) { if(result->wmProcessName.length > 0 || ffStrbufCompS(&result->wmProtocolName, FF_WM_PROTOCOL_WAYLAND) == 0) return; - Window* wmWindow = (Window*) x11GetProperty(data, display, DefaultRootWindow(display), "_NET_SUPPORTING_WM_CHECK"); + Window* wmWindow = (Window*) x11GetProperty(data, data->display, DefaultRootWindow(data->display), "_NET_SUPPORTING_WM_CHECK"); if(wmWindow == NULL) return; - char* wmName = (char*) x11GetProperty(data, display, *wmWindow, "WM_NAME"); + char* wmName = (char*) x11GetProperty(data, data->display, *wmWindow, "WM_NAME"); if(!ffStrSet(wmName)) - wmName = (char*) x11GetProperty(data, display, *wmWindow, "_NET_WM_NAME"); + wmName = (char*) x11GetProperty(data, data->display, *wmWindow, "_NET_WM_NAME"); if(ffStrSet(wmName)) ffStrbufSetS(&result->wmProcessName, wmName); @@ -64,35 +68,13 @@ static void x11DetectWMFromEWMH(X11PropertyData* data, Display* display, FFDispl data->ffXFree(wmWindow); } -static void x11FetchServerVendor(X11PropertyData* data, Display* display, FFDisplayServerResult* result) +static void x11FetchServerVendor(XrandrData* data, FFDisplayServerResult* result) { - const char* serverVendor = data->ffXServerVendor(display); - if (serverVendor && !ffStrEquals(serverVendor, "The X.Org Foundation")) { + const char* serverVendor = data->ffXServerVendor(data->display); + if (serverVendor && !ffStrEquals(serverVendor, "The X.Org Foundation")) ffStrbufSetS(&result->wmProtocolName, serverVendor); - } } -typedef struct XrandrData -{ - FF_LIBRARY_SYMBOL(XInternAtom) - FF_LIBRARY_SYMBOL(XGetAtomName); - FF_LIBRARY_SYMBOL(XFree); - FF_LIBRARY_SYMBOL(XRRGetMonitors) - FF_LIBRARY_SYMBOL(XRRGetScreenResourcesCurrent) - FF_LIBRARY_SYMBOL(XRRGetOutputInfo) - FF_LIBRARY_SYMBOL(XRRGetOutputProperty) - FF_LIBRARY_SYMBOL(XRRGetCrtcInfo) - FF_LIBRARY_SYMBOL(XRRFreeCrtcInfo) - FF_LIBRARY_SYMBOL(XRRFreeOutputInfo) - FF_LIBRARY_SYMBOL(XRRFreeScreenResources) - FF_LIBRARY_SYMBOL(XRRFreeMonitors) - - //Init once - Display* display; - FFDisplayServerResult* result; - X11PropertyData* propData; -} XrandrData; - static bool xrandrHandleCrtc(XrandrData* data, XRROutputInfo* output, FFstrbuf* name, bool primary, FFDisplayType displayType, uint8_t* edidData, uint32_t edidLength, XRRScreenResources* screenResources, uint8_t bitDepth, double scaleFactor) { //We do the check here, because we want the best fallback display if this call failed @@ -247,7 +229,7 @@ static bool xrandrHandleMonitors(XrandrData* data, Screen* screen) XRRScreenResources* screenResources = data->ffXRRGetScreenResourcesCurrent(data->display, RootWindowOfScreen(screen)); double scaleFactor = 1; - char* resourceManager = (char*) x11GetProperty(data->propData, data->display, screen->root, "RESOURCE_MANAGER"); + char* resourceManager = (char*) x11GetProperty(data, data->display, screen->root, "RESOURCE_MANAGER"); if (resourceManager) { FF_STRBUF_AUTO_DESTROY dpi = ffStrbufCreate(); @@ -307,6 +289,8 @@ const char* ffdsConnectXrandr(FFDisplayServerResult* result) FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xrandr, data, XInternAtom); FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xrandr, data, XGetAtomName); + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xrandr, data, XGetWindowProperty); + FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xrandr, data, XServerVendor); FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xrandr, data, XFree); FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xrandr, data, XRRGetMonitors); FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xrandr, data, XRRGetScreenResourcesCurrent); @@ -318,17 +302,13 @@ const char* ffdsConnectXrandr(FFDisplayServerResult* result) FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xrandr, data, XRRFreeScreenResources); FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xrandr, data, XRRFreeMonitors); - X11PropertyData propertyData; - bool propertyDataInitialized = x11InitPropertyData(xrandr, &propertyData); - data.propData = &propertyData; - data.display = ffXOpenDisplay(NULL); if(data.display == NULL) return "XOpenDisplay() failed"; - if(propertyDataInitialized && ScreenCount(data.display) > 0) { - x11DetectWMFromEWMH(&propertyData, data.display, result); - x11FetchServerVendor(&propertyData, data.display, result); + if(ScreenCount(data.display) > 0) { + x11DetectWMFromEWMH(&data, result); + x11FetchServerVendor(&data, result); } data.result = result; From 57aa0cf4995fbd02339a09305eff18bafa1b2db1 Mon Sep 17 00:00:00 2001 From: Rain Xelelo Date: Tue, 13 Jan 2026 04:04:38 +0200 Subject: [PATCH 07/14] Logo (Builtin): updates PrismLinux and adds a small variant (#2141) * Add files via upload * Update builtin.c * Update builtin.c * Update builtin.c * PrismLinux logo update + small variant * Update ASCII art in prismlinux.txt * Revise ASCII art in prismlinux_small.txt Updated ASCII art in prismlinux_small.txt --------- Co-authored-by: Carter Li --- src/logo/ascii/prismlinux.txt | 38 ++++++++++++++++------------- src/logo/ascii/prismlinux_small.txt | 13 ++++++++++ src/logo/builtin.c | 10 ++++++++ 3 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 src/logo/ascii/prismlinux_small.txt diff --git a/src/logo/ascii/prismlinux.txt b/src/logo/ascii/prismlinux.txt index ac27877191..237ac3993a 100644 --- a/src/logo/ascii/prismlinux.txt +++ b/src/logo/ascii/prismlinux.txt @@ -1,17 +1,21 @@ - .;oo;. - .;ldddol;. - .:cldddddolc:. - ':lloddddoooolcc:' - ':lllodddddooooolccc:, - ,:lllloddddooooollllccccc,. - .,clllllddddooooollllllccc::::,. - .,clllllloodoooooooollllccc:::::::,. -'cllllllllllllloooooollcccc::::::::::, - ,lllllllllllllooooolllccc::::::::::, - ,cllllllllllllloollllcc::::::::::; - 'clllllllllllllllcccc::::::::;:, - .clllllllccccc::cc:::::::::;:' - .cllllccccc:;;;:cc::::::;;:. - .cccccccc;;;:::::cc:::;;:. - .:cccc;;;:::::::::c::;:. - .;::::;;;;;;;;;;;;;::. + ⣤⣤ ⢀⡄ + ⢀⣾⣦ ⠙⠛ ⢀⣴⣿⣷ ⢠⣤ + ⣤⡄ ⣸⣿⣿⣷⣄ ⣠⣶⣿⣿⣿⣿ ⠈⠉ ⢀⣤⡀ + ⠉⠁ ⢠⣿⣿⣿⣿⣿⣦⡈⢿⣿⣿⣿⣿⣿⡇⢀⣀⣤⣤⣤⣤⣴⣶⠆⠘⠿⠃ ⠉ ⡀ + ⢤⣄⡀ ⣾⣿⣿⣿⣿⣿⣿⣷⡄⠻⣿⣿⣿⣿⡇⢸⣿⣿⣿⣿⣿⣿⡏ ⡇ + ⠘⣿⣿⣿⣿⣶⣤⣈⣉⠛⠿⢿⣿⣿⣿⣿⣦⠘⢿⣿⣿⣷⠈⣿⣿⣿⣿⣿⠏ ⠐⠁ + ⢿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⣤⣉⡛⠻⢿⣷⣄⠻⣿⣿ ⣿⣿⣿⣿⠟⢠⣀ ⡐⠁ + ⢰⣶ ⠘⣿⣿⣿⣿⣿⣿⣿⠿⠿⠛⠛⠉⠉ ⠈⠉ ⠘⣿ ⣿⣿⣿⡏⢠⣿⣿⣿⣶⣦⣄⡀ ⠂ + ⠈⠁ ⠙⠋⣉⣉⣤⣤⣶⣶⠾⠉ ⠈ ⢹⣿⠏⢠⣿⣿⣿⣿⣿⣿⣿⣿⠟ + ⢀⣠⣤⣴⣶⣿⣿⣿⣿⣿⣿⣿⠟⠁ ⢸⠟⣰⣿⣿⣿⣿⣿⡿⠟⠉ + ⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⠟⢁⣴⡏ ⠈⣰⣿⣿⣿⠿⠛⣁⡀ ⢀⡒ + ⢤⡀ ⠙⢿⣿⣿⣿⠟⢁⣴⣿⣿ ⣰⡿⠟⢉⣠⣴⣾⣿⣿⣆ + ⠛⠁ ⠔ ⠈⠛⢁⣴⣿⣿⣿⡇⢰⡆ ⠊⣁⣤⣾⣿⣿⣿⣿⣿⣿⣿⣷⡀ + ⡠⠂ ⢀⣴⣿⣿⣿⣿⣿⠃⣾⣿⡄⢢⡀ ⠤⠶⠿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄ + ⢀⠈ ⢀⣴⣿⣿⣿⣿⣿⣿⡿⢠⣿⣿⣷ ⢿⣷⣄⠑⢶⣶⣶⣶⣶⣶⣤⣤⣤⣤⣤⣤ +⠠⠁ ⠚⠛⠿⠿⢿⣿⣿⣿⡇⢸⣿⣿⣿⣧⠈⢿⣿⣿⣦⣌⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⡄ ⢰⣶ +⡆ ⣼⣿⣿⣿⣿⣇⠘⣿⣿⣿⣿⣿⣦⣈⠛⢿⣿⣿⣿⣿⣿⡇ +⢁ ⣀ ⠄⠂⠁⢀⣿⣿⣿⣿⣿⣿⡆⠹⣿⣿⣿⣿⣿⣿⠗ ⠈⠛⢿⣿⣿⡇ + ⠁⠂ ⠒⠒⠈⠁ ⢸⣿⣿⣿⠿⠛⠉ ⢻⣿⣿⣿⣿⠟ ⠈⠙⠃ + ⠼⠛⠉⠁ ⢻⣿⣿⠏ ⢀⣄ + ⠿⠇ ⠈⠿⠁ ⠘⠋ diff --git a/src/logo/ascii/prismlinux_small.txt b/src/logo/ascii/prismlinux_small.txt new file mode 100644 index 0000000000..35e43d45d6 --- /dev/null +++ b/src/logo/ascii/prismlinux_small.txt @@ -0,0 +1,13 @@ + ⢠⣦⡀⠘⠁⢀⣴⣾ ⢀⡄ + ⠛ ⣸⣿⣿⣄⢰⣿⣿⣿⡄⢀⣀⣀⣀⡀⢾⠆⠐⠂⢄ + ⠰⣤⣄⡀ ⢿⣿⣿⣿⣧⡹⣿⣿⡇⣿⣿⣿⡿⠁ + ⢻⣿⣿⣿⣶⣶⣭⣝⡻⠷⣌⢿⡇⢸⣿⡿⢁⣀ + ⠘⠛ ⠸⠿⠟⣛⣋⡭⠅ ⠻⢸⡿⢡⣿⣿⣿⣶⣤⠁ + ⠠⣤⣶⣶⣿⣿⡿⢋ ⠸⣡⣿⣿⡿⠟⠉ + ⢠ ⠈⠻⣿⡿⢋⣴⡟ ⢰⠟⣋⣥⣾⣦⡀ ⠁ + ⠈⠠⠊ ⢈⣴⣿⣿⣇⣧⢀ ⢀⣠⣴⣿⣿⣿⣿⣿⣷⡄ + ⣰⣿⣿⣿⣿⢹⣿⣆⢳⣦⣐⠶⣶⣦⣤⣬⣭⣭⠉⢉⠉⠉ +⡀ ⠈⠉⠉⢉⢸⣿⣿⣆⢻⣿⣷⣮⡙⢿⣿⣿⣿ ⠉ + ⣀⣀ ⠄⠐⠈ ⣾⣿⣿⠿ ⣿⣿⣿⡿ ⠉⠻⢿ + ⠛⠉ ⢀⡀⠘⣿⠟ ⢠⡀ + ⠈⠁ ⠁ diff --git a/src/logo/builtin.c b/src/logo/builtin.c index 9138d19093..996fb79e93 100644 --- a/src/logo/builtin.c +++ b/src/logo/builtin.c @@ -4060,6 +4060,16 @@ static const FFlogo P[] = { FF_COLOR_FG_BLUE, }, }, + // PrismLinuxSmall + { + .names = {"PrismLinux_small"}, + .type = FF_LOGO_LINE_TYPE_SMALL_BIT, + .lines = FASTFETCH_DATATEXT_LOGO_PRISMLINUX_SMALL, + .colors = { + FF_COLOR_FG_BLUE, + FF_COLOR_FG_BLUE, + }, + }, // LAST {}, }; From 3d84ad19bebd93ab85a6317bc39168a5ba14bf25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 13 Jan 2026 10:12:14 +0800 Subject: [PATCH 08/14] macOS: uses `MACH_PORT_NULL` to maintain compatibility with older SDKs Fixes #2140 --- src/detection/bootmgr/bootmgr_apple.c | 4 ++-- src/detection/physicalmemory/physicalmemory_apple.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detection/bootmgr/bootmgr_apple.c b/src/detection/bootmgr/bootmgr_apple.c index c7e1bde736..2e00f7f234 100644 --- a/src/detection/bootmgr/bootmgr_apple.c +++ b/src/detection/bootmgr/bootmgr_apple.c @@ -7,7 +7,7 @@ static const char* detectSecureBoot(bool* result) { #if __aarch64__ - FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(kIOMainPortDefault, "IODeviceTree:/chosen"); + FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(MACH_PORT_NULL, "IODeviceTree:/chosen"); if (!entryDevice) return "IORegistryEntryFromPath() failed"; @@ -20,7 +20,7 @@ static const char* detectSecureBoot(bool* result) *result = (bool) *CFDataGetBytePtr((CFDataRef) prop); #else - FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(kIOMainPortDefault, "IODeviceTree:/options"); + FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(MACH_PORT_NULL, "IODeviceTree:/options"); if (!entryDevice) return "IORegistryEntryFromPath() failed"; diff --git a/src/detection/physicalmemory/physicalmemory_apple.m b/src/detection/physicalmemory/physicalmemory_apple.m index 2812f77072..64b73d9b34 100644 --- a/src/detection/physicalmemory/physicalmemory_apple.m +++ b/src/detection/physicalmemory/physicalmemory_apple.m @@ -123,7 +123,7 @@ static void appendDevice( FF_MAYBE_UNUSED static const char* detectFromIokit(FFlist* result) { - FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(kIOMainPortDefault, "IODeviceTree:/chosen"); + FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t entryDevice = IORegistryEntryFromPath(MACH_PORT_NULL, "IODeviceTree:/chosen"); if (!entryDevice) return "IORegistryEntryFromPath() failed"; From 49fc95689da9a574ec0b9c63ac759d35b9da73c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 13 Jan 2026 10:42:31 +0800 Subject: [PATCH 09/14] Platform (Windows): improves hostname retrieval by adding fallback to NetBIOS name --- src/common/impl/FFPlatform_windows.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/common/impl/FFPlatform_windows.c b/src/common/impl/FFPlatform_windows.c index d5b7433e6d..cd138dc22a 100644 --- a/src/common/impl/FFPlatform_windows.c +++ b/src/common/impl/FFPlatform_windows.c @@ -155,10 +155,16 @@ static void getUserName(FFPlatform* platform) static void getHostName(FFPlatform* platform) { - wchar_t buffer[128]; + wchar_t buffer[256]; DWORD len = ARRAY_SIZE(buffer); - if(GetComputerNameExW(ComputerNameDnsHostname, buffer, &len)) - ffStrbufSetWS(&platform->hostName, buffer); + if (GetComputerNameExW(ComputerNameDnsHostname, buffer, &len) && len > 0) + ffStrbufSetNWS(&platform->hostName, len, buffer); + else + { + len = ARRAY_SIZE(buffer); + if (GetComputerNameExW(ComputerNameNetBIOS, buffer, &len) && len > 0) + ffStrbufSetNWS(&platform->hostName, len, buffer); + } } static void getUserShell(FFPlatform* platform) From e6bd1c340f57c0f3e227eb3fb6c45ee1f4da5f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 13 Jan 2026 18:33:02 +0800 Subject: [PATCH 10/14] Common: add `on_scope_exit` utility for scope-based resource management --- src/common/windows/util.hpp | 19 +++++++++++++++++++ src/detection/bluetooth/bluetooth_windows.cpp | 10 +--------- src/detection/camera/camera_windows.cpp | 10 +--------- src/detection/gpu/gpu_wsl.cpp | 10 +--------- src/detection/wm/wm_windows.cpp | 11 +---------- 5 files changed, 23 insertions(+), 37 deletions(-) create mode 100644 src/common/windows/util.hpp diff --git a/src/common/windows/util.hpp b/src/common/windows/util.hpp new file mode 100644 index 0000000000..9891d638c1 --- /dev/null +++ b/src/common/windows/util.hpp @@ -0,0 +1,19 @@ +#pragma once + +#include +#include + +template +struct on_scope_exit { + static_assert(std::is_nothrow_move_constructible::value, + "Fn must be nothrow move constructible"); + + explicit on_scope_exit(Fn &&fn) noexcept + : _fn(std::move(fn)) {}; + on_scope_exit(const on_scope_exit&) = delete; + on_scope_exit& operator=(const on_scope_exit&) = delete; + ~on_scope_exit() noexcept { this->_fn(); } + +private: + Fn _fn; +}; diff --git a/src/detection/bluetooth/bluetooth_windows.cpp b/src/detection/bluetooth/bluetooth_windows.cpp index 069084b244..f4ac9c9c7e 100644 --- a/src/detection/bluetooth/bluetooth_windows.cpp +++ b/src/detection/bluetooth/bluetooth_windows.cpp @@ -4,18 +4,10 @@ extern "C" } #include "common/windows/wmi.hpp" #include "common/windows/unicode.hpp" +#include "common/windows/util.hpp" STDAPI InitVariantFromStringArray(_In_reads_(cElems) PCWSTR *prgsz, _In_ ULONG cElems, _Out_ VARIANT *pvar); -template -struct on_scope_exit { - on_scope_exit(Fn &&fn): _fn(std::move(fn)) {} - ~on_scope_exit() { this->_fn(); } - -private: - Fn _fn; -}; - extern "C" const char* ffBluetoothDetectBattery(FFlist* devices) { diff --git a/src/detection/camera/camera_windows.cpp b/src/detection/camera/camera_windows.cpp index a1b9f9763a..91221374fd 100644 --- a/src/detection/camera/camera_windows.cpp +++ b/src/detection/camera/camera_windows.cpp @@ -4,20 +4,12 @@ extern "C" { } #include "common/windows/com.hpp" #include "common/windows/unicode.hpp" +#include "common/windows/util.hpp" #include #include #include -template -struct on_scope_exit { - on_scope_exit(Fn &&fn): _fn(std::move(fn)) {} - ~on_scope_exit() { this->_fn(); } - -private: - Fn _fn; -}; - extern "C" const char* ffDetectCamera(FF_MAYBE_UNUSED FFlist* result) { diff --git a/src/detection/gpu/gpu_wsl.cpp b/src/detection/gpu/gpu_wsl.cpp index f2351a9e0c..f000194e1c 100644 --- a/src/detection/gpu/gpu_wsl.cpp +++ b/src/detection/gpu/gpu_wsl.cpp @@ -6,6 +6,7 @@ extern "C" { #include "detection/gpu/gpu.h" #include "detection/gpu/gpu_driver_specific.h" } +#include "common/windows/util.hpp" #include #include @@ -16,15 +17,6 @@ extern "C" { #pragma GCC diagnostic ignored "-Wmissing-field-initializers" -template -struct on_scope_exit { - on_scope_exit(Fn &&fn): _fn(std::move(fn)) {} - ~on_scope_exit() { this->_fn(); } - -private: - Fn _fn; -}; - extern "C" const char* ffGPUDetectByDirectX(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* gpus) { diff --git a/src/detection/wm/wm_windows.cpp b/src/detection/wm/wm_windows.cpp index 793d57d510..84ee1bde2f 100644 --- a/src/detection/wm/wm_windows.cpp +++ b/src/detection/wm/wm_windows.cpp @@ -7,22 +7,13 @@ extern "C" } #include "common/windows/com.hpp" +#include "common/windows/util.hpp" -#include #include #include #include #include -template -struct on_scope_exit { - on_scope_exit(Fn &&fn): _fn(std::move(fn)) {} - ~on_scope_exit() { this->_fn(); } - -private: - Fn _fn; -}; - extern "C" const char* ffDetectWMPlugin(FFstrbuf* pluginName) { From 501746a270c8e0a11b4bff573e6601115e747259 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 14 Jan 2026 08:50:56 +0800 Subject: [PATCH 11/14] Logo: removes unneeded `#include`s Fixes #2143 --- src/modules/logo/logo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/logo/logo.c b/src/modules/logo/logo.c index 1d47a52cad..a6fbc7d509 100644 --- a/src/modules/logo/logo.c +++ b/src/modules/logo/logo.c @@ -1,7 +1,5 @@ -#include "3rdparty/yyjson/yyjson.h" #include "common/printing.h" #include "logo/logo.h" -#include "fastfetch.h" #include "modules/logo/logo.h" #include "options/logo.h" From 1699d1498489d2494e11cb3c78872241c660b462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 14 Jan 2026 10:03:51 +0800 Subject: [PATCH 12/14] Common: ensures thread safety of `ffTimeInitQpcMultiplier` --- src/common/impl/time.c | 8 ++++++++ src/common/time.h | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/common/impl/time.c b/src/common/impl/time.c index 40bd9b6ffc..2927f97840 100644 --- a/src/common/impl/time.c +++ b/src/common/impl/time.c @@ -84,4 +84,12 @@ FFTimeGetAgeResult ffTimeGetAge(uint64_t birthMs, uint64_t nowMs) #ifdef _WIN32 double ffQpcMultiplier; + + __attribute__((constructor)) + static void ffTimeInitQpcMultiplier(void) + { + LARGE_INTEGER frequency; + QueryPerformanceFrequency(&frequency); + ffQpcMultiplier = 1000. / (double) frequency.QuadPart; + } #endif diff --git a/src/common/time.h b/src/common/time.h index de32bb8430..d8506d3b87 100644 --- a/src/common/time.h +++ b/src/common/time.h @@ -25,12 +25,6 @@ static inline double ffTimeGetTick(void) //In msec { #ifdef _WIN32 extern double ffQpcMultiplier; - if (ffQpcMultiplier == 0) - { - LARGE_INTEGER frequency; - QueryPerformanceFrequency(&frequency); - ffQpcMultiplier = 1000. / (double) frequency.QuadPart; - } LARGE_INTEGER start; QueryPerformanceCounter(&start); return (double) start.QuadPart * ffQpcMultiplier; From 5ef630cbc866f3cf1ab1b4b0c3e1d5666fdf9cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 14 Jan 2026 13:20:55 +0800 Subject: [PATCH 13/14] Release: v2.57.1 --- CHANGELOG.md | 18 ++++++++++++++++-- CMakeLists.txt | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd796459fa..e4db07808a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# 2.57.1 + +Features: +* Tiny performance improvements (Windows) +* Improves the reliability of hostname retrieval (Title, Windows) + +Bugfixes: +* Fixes potential compilation issues on Linux (#2142, Linux) +* Fixes compilation errors on macOS when building with older SDKs (#2140, macOS) +* Fixes compilation issues when building with `-DENABLE_SYSTEM_YYJSON=ON` (#2143) + +Logos: +* Updates PrismLinux and adds a small variant + # 2.57.0 Deprecation notice: @@ -15,8 +29,8 @@ Features: * Supports Secure Boot detection (Bootmgr, macOS) * Supports DPI scale factor detection on Windows 7 (Display, Windows) * Supports xterm 256-color codes in color configuration - * In `display.color`: "@" (e.g., "@34" for color index 34) - * In `*.format` strings: "#@" (e.g., "#@34" for color index 34) + * In `display.color`: "`@`" (e.g., "`@34`" for color index `34`) + * In `*.format` strings: "`#@`" (e.g., "`#@34`" for color index `34`) * Improves uptime accuracy on Windows 10+ (Uptime, Windows) * Adds a new module `Logo` to query built-in logo raw data in JSON output (Logo) * Usage: `fastfetch -s logo -l -j # Supported in JSON format only` diff --git a/CMakeLists.txt b/CMakeLists.txt index e42ec5080a..05718e9705 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.57.0 + VERSION 2.57.1 LANGUAGES C DESCRIPTION "Fast neofetch-like system information tool" HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch" From ba0eeab18c7f1ebd3266211f035f19d08e106699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 14 Jan 2026 13:47:40 +0800 Subject: [PATCH 14/14] DisplayServer (Linux): cleanup code --- src/detection/displayserver/linux/xlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detection/displayserver/linux/xlib.c b/src/detection/displayserver/linux/xlib.c index 9490b040dc..8820ad9355 100644 --- a/src/detection/displayserver/linux/xlib.c +++ b/src/detection/displayserver/linux/xlib.c @@ -13,10 +13,10 @@ typedef struct XrandrData { FF_LIBRARY_SYMBOL(XInternAtom) - FF_LIBRARY_SYMBOL(XGetAtomName); + FF_LIBRARY_SYMBOL(XGetAtomName) FF_LIBRARY_SYMBOL(XGetWindowProperty) FF_LIBRARY_SYMBOL(XServerVendor) - FF_LIBRARY_SYMBOL(XFree); + FF_LIBRARY_SYMBOL(XFree) FF_LIBRARY_SYMBOL(XRRGetMonitors) FF_LIBRARY_SYMBOL(XRRGetScreenResourcesCurrent) FF_LIBRARY_SYMBOL(XRRGetOutputInfo)