Removed GTK2 compatibility shims from fe-gtk.h by deleting the local HAVE_GTK3 fallback derivation, deleting GTK2 no-op wrappers for expansion APIs, and making InputStyle GTK3-only.

Simplified the Windows theme block in fe-gtk.c from a GTK3-conditional compile guard to a direct Windows guard (#ifdef G_OS_WIN32), matching the GTK3-only codebase direction.

Simplified native file chooser guards in gtkutil.c from WIN32 && HAVE_GTK3 to #ifdef WIN32, removing remaining GTK3 compatibility-condition clutter in that file.
This commit is contained in:
2026-02-22 15:27:28 -07:00
parent 743bf334d4
commit 4b188192f8
3 changed files with 3 additions and 23 deletions

View File

@@ -673,7 +673,7 @@ fe_apply_theme_to_toplevel (GtkWidget *window)
if (!window)
return;
#if defined(G_OS_WIN32) && HAVE_GTK3
#ifdef G_OS_WIN32
{
GtkStyleContext *context = gtk_widget_get_style_context (window);
gboolean dark = fe_dark_mode_is_enabled ();

View File

@@ -32,22 +32,6 @@
#include <gtk/gtk.h>
#include <cairo.h>
#ifndef HAVE_GTK3
#if GTK_MAJOR_VERSION >= 3
#define HAVE_GTK3 1
#else
#define HAVE_GTK3 0
#endif
#endif
#if !HAVE_GTK3
/* GtkWidget expansion APIs were introduced in GTK3. Keep GTK2 builds
* source-compatible by accepting the calls as no-ops.
*/
#define gtk_widget_set_hexpand(widget, expand) G_STMT_START { (void) (widget); (void) (expand); } G_STMT_END
#define gtk_widget_set_vexpand(widget, expand) G_STMT_START { (void) (widget); (void) (expand); } G_STMT_END
#endif
#ifdef HAVE_GTK_MAC
#include <gtkosxapplication.h>
#endif
@@ -64,14 +48,10 @@
#define flag_b flag_wid[7]
#define NUM_FLAG_WIDS 8
#if HAVE_GTK3
typedef struct _input_style
{
PangoFontDescription *font_desc;
} InputStyle;
#else
typedef GtkStyle InputStyle;
#endif
#ifdef HAVE_GTK_MAC
extern GtkosxApplication *osx_app;

View File

@@ -686,7 +686,7 @@ gtkutil_file_req_response (GtkWidget *dialog, gint res, struct file_req *freq)
gtk_widget_destroy (dialog);
}
#if defined (WIN32) && HAVE_GTK3
#ifdef WIN32
static gboolean
gtkutil_native_dialog_unref_idle (gpointer native)
{
@@ -730,7 +730,7 @@ gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *us
xdir = get_xdir ();
#if defined (WIN32) && HAVE_GTK3
#ifdef WIN32
{
GtkFileChooserNative *native = gtk_file_chooser_native_new (
title,