Skip to content

Commit b001ea4

Browse files
authored
Merge pull request #1056 from fastfetch-cli/dev
Release: v2.17.1
2 parents 74616c7 + f97a9fd commit b001ea4

File tree

10 files changed

+52
-18
lines changed

10 files changed

+52
-18
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 2.17.1
2+
3+
Hotfix for a regression that breaks Qt font detection
4+
5+
Bugfixes:
6+
* Don't generate and install `libffwinrt.dll.a` on MinGW (Windows)
7+
* Fix building on Windows when imagemagick support is enabled (Logo, Windows)
8+
* Don't print GPU frequency with `--gpu-temp` for Nvidia cards (#1052, GPU)
9+
* `--gpu-driver-specific` needs to be specified
10+
* Print formatted size when `--gpu-format` is used (#1052, GPU)
11+
* Ignore QVariant format; fix unreadable Qt font (#1053, Theme, Linux)
12+
* Fix segfaults with `--show-errors` and an invalid module (#1055)
13+
114
# 2.17.0
215

316
Changes:

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
22

33
project(fastfetch
4-
VERSION 2.17.0
4+
VERSION 2.17.1
55
LANGUAGES C
66
DESCRIPTION "Fast neofetch-like system information tool"
77
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
@@ -1156,7 +1156,7 @@ if(WIN32)
11561156
include(CheckIncludeFileCXX)
11571157
CHECK_INCLUDE_FILE_CXX("winrt/Windows.Foundation.h" HAVE_WINRT)
11581158
if(HAVE_WINRT)
1159-
add_library(ffwinrt SHARED src/detection/media/media_windows.dll.cpp)
1159+
add_library(ffwinrt MODULE src/detection/media/media_windows.dll.cpp)
11601160
target_link_libraries(ffwinrt PRIVATE "RuntimeObject")
11611161
target_compile_definitions(ffwinrt PRIVATE WIN32_LEAN_AND_MEAN=1 WINRT_LEAN_AND_MEAN=1)
11621162
target_link_options(ffwinrt

src/common/io/io.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
#include <handleapi.h>
99
#include <io.h>
1010
typedef HANDLE FFNativeFD;
11+
#define FF_INVALID_FD INVALID_HANDLE_VALUE
1112
#else
1213
#include <unistd.h>
1314
#include <dirent.h>
1415
#include <sys/stat.h>
1516
typedef int FFNativeFD;
17+
#define FF_INVALID_FD (-1)
1618
// procfs's file can be changed between read calls such as /proc/meminfo and /proc/uptime.
1719
// one safe way to read correct data is reading the whole file in a single read syscall
1820
// 8192 comes from procps-ng: https://gitlab.com/procps-ng/procps/-/blob/master/library/meminfo.c?ref_type=heads#L39

src/common/printing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
6464
if(!instance.config.display.pipe)
6565
{
6666
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
67-
if (moduleArgs->outputColor.length)
67+
if (moduleArgs && moduleArgs->outputColor.length)
6868
ffPrintColor(&moduleArgs->outputColor);
6969
else if (instance.config.display.colorOutput.length)
7070
ffPrintColor(&instance.config.display.colorOutput);

src/detection/gpu/gpu_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
273273
.memory = options->driverSpecific ? &gpu->dedicated : NULL,
274274
.coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL,
275275
.type = &gpu->type,
276-
.frequency = &gpu->frequency,
276+
.frequency = options->driverSpecific ? &gpu->frequency : NULL,
277277
}, "libnvidia-ml.so");
278278
}
279279

src/detection/gpu/gpu_windows.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
162162
.memory = options->driverSpecific ? &gpu->dedicated : NULL,
163163
.coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL,
164164
.type = &gpu->type,
165-
.frequency = &gpu->frequency,
165+
.frequency = options->driverSpecific ? &gpu->frequency : NULL,
166166
},
167167
dllName
168168
);

src/detection/gpu/gpu_wsl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const char* ffGPUDetectByDirectX(FF_MAYBE_UNUSED const FFGPUOptions* options, FF
120120
.memory = options->driverSpecific ? &gpu->dedicated : NULL,
121121
.coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL,
122122
.type = &gpu->type,
123-
.frequency = &gpu->frequency,
123+
.frequency = options->driverSpecific ? &gpu->frequency : NULL,
124124
}, "/usr/lib/wsl/lib/libnvidia-ml.so");
125125
}
126126
}

src/detection/gtk_qt/qt.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,16 @@ static void detectQtCt(char qver, FFQtResult* result)
144144
ffParsePropFileConfigValues(file, 3, (FFpropquery[]) {
145145
{"style=", &result->widgetStyle},
146146
{"icon_theme=", &result->icons},
147-
// FIXME: on older versions this was hex-encoded binary format
148-
// (See QVariant notes on https://doc.qt.io/qt-5/qsettings.html)
149-
// Thankfully, newer versions use the more common font encoding.
150147
{"general=", &result->font}
151148
});
149+
150+
if (ffStrbufStartsWithC(&result->font, '@'))
151+
{
152+
// See QVariant notes on https://doc.qt.io/qt-5/qsettings.html and
153+
// https://github.com/fastfetch-cli/fastfetch/issues/1053#issuecomment-2197254769
154+
// Thankfully, newer versions use the more common font encoding.
155+
ffStrbufSetNS(&result->font, 5, file);
156+
}
152157
}
153158

154159
static void detectKvantum(FFQtResult* result)

src/logo/image/image.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -670,15 +670,20 @@ FFLogoImageResult ffLogoPrintImageImpl(FFLogoRequestData* requestData, const FFI
670670
return printSuccessful ? FF_LOGO_IMAGE_RESULT_SUCCESS : FF_LOGO_IMAGE_RESULT_RUN_ERROR;
671671
}
672672

673-
static int getCacheFD(FFLogoRequestData* requestData, const char* fileName)
673+
static FFNativeFD getCacheFD(FFLogoRequestData* requestData, const char* fileName)
674674
{
675675
uint32_t cacheDirLength = requestData->cacheDir.length;
676676
ffStrbufAppendS(&requestData->cacheDir, fileName);
677+
#ifndef _WIN32
677678
int fd = open(requestData->cacheDir.chars, O_RDONLY
678679
#ifdef O_CLOEXEC
679680
| O_CLOEXEC
680681
#endif
681682
);
683+
#else
684+
HANDLE fd = CreateFileA(requestData->cacheDir.chars, GENERIC_READ,
685+
FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
686+
#endif
682687
ffStrbufSubstrBefore(&requestData->cacheDir, cacheDirLength);
683688
return fd;
684689
}
@@ -740,17 +745,17 @@ static bool printCachedPixel(FFLogoRequestData* requestData)
740745
return false;
741746
}
742747

743-
FF_AUTO_CLOSE_FD int fd = -1;
748+
FF_AUTO_CLOSE_FD FFNativeFD fd = FF_INVALID_FD;
744749
if(requestData->type == FF_LOGO_TYPE_IMAGE_KITTY)
745750
{
746751
fd = getCacheFD(requestData, FF_CACHE_FILE_KITTY_COMPRESSED);
747-
if(fd == -1)
752+
if(fd == FF_INVALID_FD)
748753
fd = getCacheFD(requestData, FF_CACHE_FILE_KITTY_UNCOMPRESSED);
749754
}
750755
else if(requestData->type == FF_LOGO_TYPE_IMAGE_SIXEL)
751756
fd = getCacheFD(requestData, FF_CACHE_FILE_SIXEL);
752757

753-
if(fd == -1)
758+
if(fd == FF_INVALID_FD)
754759
return false;
755760

756761
ffPrintCharTimes('\n', options->paddingTop);
@@ -783,7 +788,7 @@ static bool printCachedPixel(FFLogoRequestData* requestData)
783788
{
784789
char buffer[32768];
785790
ssize_t readBytes;
786-
while((readBytes = ffReadFDData(FFUnixFD2NativeFD(fd), sizeof(buffer), buffer)) > 0)
791+
while((readBytes = ffReadFDData(fd, sizeof(buffer), buffer)) > 0)
787792
ffWriteFDData(FFUnixFD2NativeFD(STDOUT_FILENO), (size_t) readBytes, buffer);
788793
}
789794

src/modules/gpu/gpu.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,26 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu
7575
{
7676
FF_STRBUF_AUTO_DESTROY tempStr = ffStrbufCreate();
7777
ffTempsAppendNum(gpu->temperature, &tempStr, options->tempConfig, &options->moduleArgs);
78+
FF_STRBUF_AUTO_DESTROY dTotal = ffStrbufCreate();
79+
FF_STRBUF_AUTO_DESTROY dUsed = ffStrbufCreate();
80+
FF_STRBUF_AUTO_DESTROY sTotal = ffStrbufCreate();
81+
FF_STRBUF_AUTO_DESTROY sUsed = ffStrbufCreate();
82+
if (gpu->dedicated.total != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->dedicated.total, &dTotal);
83+
if (gpu->dedicated.used != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->dedicated.used, &dUsed);
84+
if (gpu->shared.total != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->shared.total, &sTotal);
85+
if (gpu->shared.used != FF_GPU_VMEM_SIZE_UNSET) ffParseSize(gpu->shared.used, &sUsed);
86+
7887
FF_PRINT_FORMAT_CHECKED(FF_GPU_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_GPU_NUM_FORMAT_ARGS, ((FFformatarg[]) {
7988
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->vendor, "vendor"},
8089
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->name, "name"},
8190
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->driver, "driver"},
8291
{FF_FORMAT_ARG_TYPE_STRBUF, &tempStr, "temperature"},
8392
{FF_FORMAT_ARG_TYPE_INT, &gpu->coreCount, "core-count"},
8493
{FF_FORMAT_ARG_TYPE_STRING, type, "type"},
85-
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->dedicated.total, "dedicated-total"},
86-
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->dedicated.used, "dedicated-used"},
87-
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->shared.total, "shared-total"},
88-
{FF_FORMAT_ARG_TYPE_UINT64, &gpu->shared.used, "shared-used"},
94+
{FF_FORMAT_ARG_TYPE_STRBUF, &dTotal, "dedicated-total"},
95+
{FF_FORMAT_ARG_TYPE_STRBUF, &dUsed, "dedicated-used"},
96+
{FF_FORMAT_ARG_TYPE_STRBUF, &sTotal, "shared-total"},
97+
{FF_FORMAT_ARG_TYPE_STRBUF, &sUsed, "shared-used"},
8998
{FF_FORMAT_ARG_TYPE_STRBUF, &gpu->platformApi, "platform-api"},
9099
{FF_FORMAT_ARG_TYPE_DOUBLE, &gpu->frequency, "frequency"},
91100
}));

0 commit comments

Comments
 (0)