mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
DisplayServer (Windows): reduce system dependencies
This commit is contained in:
@@ -1715,7 +1715,6 @@ elseif(APPLE)
|
||||
)
|
||||
elseif(WIN32)
|
||||
target_link_libraries(libfastfetch
|
||||
PRIVATE "dwmapi"
|
||||
PRIVATE "gdi32"
|
||||
PRIVATE "iphlpapi"
|
||||
PRIVATE "ole32"
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
#include "common/windows/unicode.h"
|
||||
#include "common/edidHelper.h"
|
||||
|
||||
#include <dwmapi.h>
|
||||
#include <winuser.h>
|
||||
#include <windows.h>
|
||||
#include <wchar.h>
|
||||
|
||||
// http://undoc.airesoft.co.uk/user32.dll/IsThreadDesktopComposited.php
|
||||
BOOL WINAPI IsThreadDesktopComposited();
|
||||
|
||||
typedef struct FFMonitorInfo
|
||||
{
|
||||
HMONITOR handle;
|
||||
@@ -253,8 +255,7 @@ static void detectDisplays(FFDisplayServerResult* ds)
|
||||
|
||||
void ffConnectDisplayServerImpl(FFDisplayServerResult* ds)
|
||||
{
|
||||
BOOL enabled;
|
||||
if(SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled)
|
||||
if (IsThreadDesktopComposited())
|
||||
{
|
||||
ffStrbufSetStatic(&ds->wmProcessName, "dwm.exe");
|
||||
ffStrbufSetStatic(&ds->wmPrettyName, "Desktop Window Manager");
|
||||
|
||||
Reference in New Issue
Block a user