Skip to content

Commit d8c2152

Browse files
authored
Update GTK to 4.20.3 (#86)
1 parent 57e1589 commit d8c2152

File tree

11 files changed

+328
-291
lines changed

11 files changed

+328
-291
lines changed

build/nip4.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ $(PKG)_DEPS := cc meson-wrapper gtk4 adwaita-icon-theme gsl vips-all
1212
define $(PKG)_PRE_CONFIGURE
1313
(printf '{\n'; \
1414
printf ' "adwaita-icon-theme": "$(adwaita-icon-theme_VERSION)",\n'; \
15+
printf ' "directx-headers": "$(directx-headers_VERSION)",\n'; \
1516
printf ' "epoxy": "$(libepoxy_VERSION)",\n'; \
1617
printf ' "graphene": "$(graphene_VERSION)",\n'; \
1718
printf ' "gsl": "$(gsl_VERSION)",\n'; \

build/overrides.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,6 @@ define librsvg_BUILD
564564
# Enable networking while we build librsvg
565565
$(eval export MXE_ENABLE_NETWORK := 1)
566566

567-
# Ensure MXE's pkg-config wrapper finds librsvg-2.0-uninstalled.pc
568-
$(SED) -i "s/PKG_CONFIG_PATH/&_$(subst .,_,$(subst -,_,$(TARGET)))/" '$(SOURCE_DIR)/meson/cargo_wrapper.py'
569-
570567
$(MXE_MESON_WRAPPER) \
571568
--buildtype=plain \
572569
-Dintrospection=disabled \
@@ -578,7 +575,6 @@ define librsvg_BUILD
578575
-Dtests=false \
579576
-Dtriplet='$(PROCESSOR)-pc-windows-gnullvm' \
580577
-Dc_link_args='$(LDFLAGS) -lntdll -luserenv' \
581-
$(PKG_MESON_OPTS) \
582578
'$(SOURCE_DIR)' \
583579
'$(BUILD_DIR)'
584580

build/patches/gdk-pixbuf-2-fixes.patch

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,49 @@ This file is part of MXE. See LICENSE.md for licensing information.
22

33
Contains ad hoc patches for cross building.
44

5+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
6+
From: Kleis Auke Wolthuizen <[email protected]>
7+
Date: Tue, 13 Oct 2020 16:40:45 +0200
8+
Subject: [PATCH 1/2] Don't force relocation support on Windows
9+
10+
We don't use loadable modules for gdk-pixbuf.
11+
12+
diff --git a/meson.build b/meson.build
13+
index 1111111..2222222 100644
14+
--- a/meson.build
15+
+++ b/meson.build
16+
@@ -394,15 +394,8 @@ if not tiff_opt.disabled() and not native_windows_loaders
17+
endif
18+
endif
19+
20+
-# Determine whether we enable application bundle relocation support, and we use
21+
-# this always on Windows
22+
-if host_system == 'windows'
23+
- relocatable = (get_option('default_library') != 'static')
24+
-else
25+
- relocatable = get_option('relocatable')
26+
-endif
27+
-
28+
-if relocatable
29+
+# Determine whether we enable application bundle relocation support
30+
+if get_option('relocatable')
31+
add_project_arguments([ '-DGDK_PIXBUF_RELOCATABLE' ], language: 'c')
32+
endif
33+
34+
@@ -483,7 +476,7 @@ summary({
35+
'Introspection': build_gir,
36+
'Documentation': build_docs,
37+
'Manual pages': get_option('man'),
38+
- 'Relocatable': relocatable,
39+
+ 'Relocatable': get_option('relocatable'),
40+
'Build tests': get_option('tests'),
41+
'Installed tests': get_option('installed_tests'),
42+
},
43+
544
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
645
From: Kleis Auke Wolthuizen <[email protected]>
746
Date: Mon, 7 Oct 2019 11:30:00 +0200
8-
Subject: [PATCH 1/1] Fix pkg-config file when using built-in loader(s)
47+
Subject: [PATCH 2/2] Fix pkg-config file when using built-in loader(s)
948

1049
See: https://gitlab.gnome.org/GNOME/gdk-pixbuf/merge_requests/50
1150

build/patches/gdk-pixbuf-2-without-relocation.patch

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
PKG := directx-headers
2+
$(PKG)_WEBSITE := https://github.com/microsoft/DirectX-Headers
3+
$(PKG)_DESCR := Official DirectX headers available under an open source license
4+
$(PKG)_IGNORE :=
5+
$(PKG)_VERSION := 1.618.2
6+
$(PKG)_CHECKSUM := 62004f45e2ab00cbb5c7f03c47262632c22fbce0a237383fc458d9324c44cf36
7+
$(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/$(PKG)-[0-9]*.patch)))
8+
$(PKG)_GH_CONF := microsoft/DirectX-Headers/tags,v
9+
$(PKG)_DEPS := cc meson-wrapper
10+
11+
define $(PKG)_BUILD
12+
$(MXE_MESON_WRAPPER) \
13+
-Dbuild-test=false \
14+
'$(SOURCE_DIR)' \
15+
'$(BUILD_DIR)'
16+
17+
$(MXE_NINJA) -C '$(BUILD_DIR)' -j '$(JOBS)' install
18+
endef

build/plugins/gtk4/gtk4.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ PKG := gtk4
22
$(PKG)_WEBSITE := https://gtk.org/
33
$(PKG)_DESCR := GTK4
44
$(PKG)_IGNORE :=
5-
$(PKG)_VERSION := 4.18.6
6-
$(PKG)_CHECKSUM := e1817c650ddc3261f9a8345b3b22a26a5d80af154630dedc03cc7becefffd0fa
5+
$(PKG)_VERSION := 4.20.3
6+
$(PKG)_CHECKSUM := 2873f2903088a66c71173ea2ed85ffae266a66b972c3a4842bbb2f6f187ec153
77
$(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/patches/gtk-[0-9]*.patch)))
88
$(PKG)_SUBDIR := gtk-$($(PKG)_VERSION)
99
$(PKG)_FILE := gtk-$($(PKG)_VERSION).tar.xz
1010
$(PKG)_URL := https://download.gnome.org/sources/gtk/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE)
11-
$(PKG)_DEPS := cc meson-wrapper glib gdk-pixbuf pango fontconfig cairo libepoxy graphene
11+
$(PKG)_DEPS := cc meson-wrapper glib gdk-pixbuf pango fontconfig cairo libepoxy graphene librsvg directx-headers
1212

1313
define $(PKG)_BUILD
1414
# Disable tools

build/plugins/gtk4/overrides.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ glib_MESON_OPTS = --force-fallback-for=libpcre2-8
1111
cairo_PATCHES := $(filter-out $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/../../patches/cairo-1-nanoserver-compat.patch))),$(cairo_PATCHES))
1212
cairo_MESON_OPTS = -Dzlib=enabled -Ddwrite=enabled
1313

14-
# GTK requires a relocatable GDK-PixBuf plugin with SVG support.
15-
# TODO(kleisauke): Probably no longer needed in GTK >= 4.19.2.
16-
gdk-pixbuf_PATCHES := $(filter-out $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/../../patches/gdk-pixbuf-2-without-relocation.patch))),$(gdk-pixbuf_PATCHES))
17-
librsvg_DEPS := $(librsvg_DEPS) gdk-pixbuf
18-
librsvg_MESON_OPTS = -Dpixbuf=enabled -Dpixbuf-loader=enabled
19-
2014
# nip4 needs -Doutput=enabled
2115
libxml2_MESON_OPTS := $(libxml2_MESON_OPTS) -Doutput=enabled
2216

build/plugins/gtk4/patches/gtk-4-fixes.patch

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Kleis Auke Wolthuizen <[email protected]>
33
Date: Thu, 26 Oct 2023 17:00:00 +0200
4-
Subject: [PATCH 1/2] Make gtk4-builder-tool optional
4+
Subject: [PATCH 1/4] Make gtk4-builder-tool optional
55

66

77
diff --git a/docs/reference/gtk/images/meson.build b/docs/reference/gtk/images/meson.build
@@ -24,7 +24,7 @@ index 1111111..2222222 100644
2424
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2525
From: Christoph Reiter <[email protected]>
2626
Date: Sat, 7 Sep 2024 13:39:22 +0200
27-
Subject: [PATCH 2/2] Disable automatic font rendering settings
27+
Subject: [PATCH 2/4] Disable automatic font rendering settings
2828

2929
To restore the old code taking Windows settings into account.
3030

@@ -35,12 +35,62 @@ diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
3535
index 1111111..2222222 100644
3636
--- a/gtk/gtksettings.c
3737
+++ b/gtk/gtksettings.c
38-
@@ -973,7 +973,7 @@ gtk_settings_class_init (GtkSettingsClass *class)
38+
@@ -980,7 +980,7 @@ gtk_settings_class_init (GtkSettingsClass *class)
3939
*/
4040
pspecs[PROP_FONT_RENDERING] = g_param_spec_enum ("gtk-font-rendering", NULL, NULL,
4141
GTK_TYPE_FONT_RENDERING,
4242
- GTK_FONT_RENDERING_AUTOMATIC,
4343
+ GTK_FONT_RENDERING_MANUAL,
4444
GTK_PARAM_READWRITE);
4545

46-
g_object_class_install_properties (gobject_class, NUM_PROPERTIES, pspecs);
46+
/**
47+
48+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
49+
From: Christoph Reiter <[email protected]>
50+
Date: Mon, 1 Sep 2025 08:32:52 +0200
51+
Subject: [PATCH 3/4] Disable dcomp by default
52+
53+
This is equivalent to setting the `GDK_DISABLE=dcomp` env.
54+
55+
See:
56+
https://gitlab.gnome.org/GNOME/gtk/-/issues/7567
57+
https://github.com/msys2/MINGW-packages/pull/25319
58+
59+
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
60+
index 1111111..2222222 100644
61+
--- a/gdk/win32/gdkdisplay-win32.c
62+
+++ b/gdk/win32/gdkdisplay-win32.c
63+
@@ -517,7 +517,7 @@
64+
const GUID my_IID_IDCompositionDevice = { 0xC37EA93A,0xE7AA,0x450D,0xB1,0x6F,0x97,0x46,0xCB,0x04,0x07,0xF3 };
65+
IDXGIDevice *dxgi_device;
66+
67+
- if (!gdk_has_feature (GDK_FEATURE_DCOMP))
68+
+ if (!gdk_has_feature (GDK_FEATURE_DCOMP) || g_getenv ("GDK_WIN32_FORCE_DCOMP") == NULL)
69+
return;
70+
71+
hr_warn (ID3D11Device_QueryInterface (self->d3d11_device, &IID_IDXGIDevice, (void **) &dxgi_device));
72+
73+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
74+
From: Dan Yeaw <[email protected]>
75+
Date: Sun, 23 Nov 2025 15:26:12 -0500
76+
Subject: [PATCH 4/4] Windows: fix cairo crash with dcomp disabled
77+
78+
See: https://gitlab.gnome.org/GNOME/gtk/-/issues/7890
79+
80+
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gtk/-/commit/f071763fd69e8924c497b9b21e43ef8e80718eff]
81+
82+
diff --git a/gdk/win32/gdkcairocontext-win32.c b/gdk/win32/gdkcairocontext-win32.c
83+
index 1111111..2222222 100644
84+
--- a/gdk/win32/gdkcairocontext-win32.c
85+
+++ b/gdk/win32/gdkcairocontext-win32.c
86+
@@ -134,8 +134,9 @@ gdk_win32_cairo_context_surface_detach (GdkDrawContext *context)
87+
{
88+
GdkWin32CairoContext *self = GDK_WIN32_CAIRO_CONTEXT (context);
89+
GdkSurface *surface = gdk_draw_context_get_surface (context);
90+
+ GdkWin32Display *display = GDK_WIN32_DISPLAY (gdk_draw_context_get_display (context));
91+
92+
- if (!GDK_SURFACE_DESTROYED (surface))
93+
+ if (!GDK_SURFACE_DESTROYED (surface) && gdk_win32_display_get_dcomp_device (display))
94+
gdk_win32_surface_set_dcomp_content (GDK_WIN32_SURFACE (surface), NULL);
95+
96+
gdk_win32_com_clear (&self->staging_texture);

0 commit comments

Comments
 (0)