remove more gtk2

This commit is contained in:
2026-02-22 16:08:00 -07:00
parent be7b5e62be
commit 149863fdca
6 changed files with 29 additions and 9 deletions

View File

@@ -10,7 +10,7 @@ sysinfo_deps = [
]
sysinfo_includes = []
sysinfo_cargs = []
sysinfo_cargs = ['-DHAVE_CONFIG_H']
system = host_machine.system()
if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system == 'darwin' or system == 'freebsd'
@@ -19,6 +19,10 @@ if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system =
'shared/df.c'
]
if get_option('gtk-frontend')
sysinfo_cargs += '-DUSE_GTK_FRONTEND'
endif
if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system == 'freebsd'
libpci = dependency('libpci', required: false, method: 'pkg-config')
if libpci.found()
@@ -30,6 +34,10 @@ if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system =
pciids = join_paths(picidsdir, 'pci.ids')
sysinfo_cargs += '-DPCIIDS_FILE="@0@"'.format(pciids)
endif
if get_option('gtk-frontend')
sysinfo_deps += dependency('gtk+-3.0', version: '>= 3.22')
endif
sysinfo_includes += 'unix'
sysinfo_sources += [
'unix/backend.c',
@@ -52,7 +60,7 @@ endif
shared_module('sysinfo', sysinfo_sources,
dependencies: sysinfo_deps,
include_directories: include_directories(sysinfo_includes),
include_directories: [config_h_include, include_directories(sysinfo_includes)],
c_args: sysinfo_cargs,
install: true,
install_dir: plugindir,

View File

@@ -32,6 +32,10 @@
#include <glib.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "format.h"
#include "df.h"
@@ -276,7 +280,7 @@ sysinfo_backend_get_network(void)
static const char *sysinfo_detect_toolkit(void)
{
#if defined(HAVE_GTK3)
#if defined(USE_GTK_FRONTEND)
return "GTK3";
#else
return NULL;

View File

@@ -19,7 +19,11 @@
#include <glib.h>
#if defined(HAVE_GTK3)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if defined(USE_GTK_FRONTEND)
#include <gdk/gdk.h>
#endif
#include "parse.h"
@@ -175,7 +179,7 @@ char *sysinfo_backend_get_network(void)
static const char *sysinfo_detect_toolkit(void)
{
#if defined(HAVE_GTK3)
#if defined(USE_GTK_FRONTEND)
return "GTK3";
#else
return NULL;
@@ -190,7 +194,7 @@ static const char *sysinfo_detect_display_backend(void)
const gboolean session_wayland = session && g_ascii_strcasecmp(session, "wayland") == 0;
/* Best-effort: ask GDK what it actually opened, if available. */
#if defined(HAVE_GTK3)
#if defined(USE_GTK_FRONTEND)
{
GdkDisplay *display = gdk_display_get_default();
if (display)

View File

@@ -26,6 +26,10 @@
#include <glib.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "../../../src/common/sysinfo/sysinfo.h"
#include "../format.h"
@@ -106,7 +110,7 @@ static char *get_memory_info (void)
static const char *sysinfo_detect_toolkit(void)
{
#if defined(HAVE_GTK3)
#if defined(USE_GTK_FRONTEND)
return "GTK3";
#else
return NULL;