Commit graph

22,080 commits

Author SHA1 Message Date
00a6b9955b build: require gettext 0.19.3 for clean autoreconf 2026-05-05 15:28:22 +02:00
b751584a81 build: ship gtk-doc build infrastructure 2026-05-05 15:28:19 +02:00
feeacb33bc po: avoid updating translations during normal builds 2026-05-05 15:28:13 +02:00
1a553bb48d docs: add missing gtk-doc override files 2026-05-05 15:28:10 +02:00
c3147531d9 build: use LINGUAS for po-properties 2026-05-05 15:28:07 +02:00
7c42e6ae0f build: replace obsolete GLib gettext macros
Switch from the old GLib gettext macros to GNU gettext infrastructure, keep the gtk20 and gtk20-properties domains, and define GTK_LOCALEDIR without AM_GLIB_DEFINE_LOCALEDIR.
2026-05-05 15:28:00 +02:00
09183c4c85 configure: require FriBidi 0.19.2 or newer 2026-05-05 08:49:44 +02:00
6ca13e3b1c configure: make xReply header test robust against strict CFLAGS 2026-05-05 08:32:45 +02:00
b9e1547e39 build: link against FriBidi 2026-05-04 17:09:47 +02:00
a5e2391f2e Add compatibility wrappers for GLib APIs introduced after 2.38: pattern matching helpers, GFileInfo modification time handling, and GBookmarkFile recent-file metadata.
Use the newer GDateTime and renamed pattern APIs when available, while
falling back to the older time_t/GTimeVal and pattern APIs with older
GLib versions. Internally, recent timestamps continue to be stored as
gint64 where possible.
2026-05-04 17:09:47 +02:00
db6ebcde3b gtkbuilder: add fallback for older GLib
Use g_object_new_with_properties() when building against GLib 2.54 or
newer, and fall back to g_object_newv() with older GLib versions.

This allows lowering the minimum required GLib version to 2.38 while
keeping the modern constructor path available on current GLib.
2026-05-04 14:59:47 +02:00
9af12b6dde gtk,gdk: add gsize-safe memdup compatibility helpers
Use g_memdup2() when building against GLib 2.68 or newer.  For older
GLib versions, provide small internal gsize-safe fallbacks instead of
falling back to deprecated g_memdup().

This keeps compatibility with older GLib versions without reintroducing
guint-sized allocation truncation.
2026-05-04 14:18:06 +02:00
0675b80da2 gtk: avoid duplicated g_sort_array fallback code
The previous fallback duplicated the full sort call at each use site,
which was unnecessarily noisy and harder to maintain.

Add a small internal _gtk_sort_array macro instead, using g_sort_array()
when available and g_qsort_with_data() on older GLib versions.
2026-05-04 08:08:20 +02:00
9accefd2d1 bump dependencies 2026-05-03 20:54:22 +02:00
42a31c8576 Clean up trailing whitespace 2026-05-03 15:16:52 +02:00
a888e7dac8 doc: clarify instructions for Gentoo 2026-05-03 12:08:56 +02:00
32d4725cee List dependencies for Artix and Gentoo 2026-05-03 12:05:54 +02:00
2edc7fd3e9 Append README 2026-05-03 11:43:01 +02:00
8c862d8c53 Update NEWS and README 2026-05-03 11:40:47 +02:00
4bdf50166b Fix encoding in NEWS 2026-05-03 10:03:53 +02:00
c2ba22f503 gtk: add GLib version fallback for g_sort_array
Use g_sort_array() with GLib 2.82 and newer, and fall back to
g_qsort_with_data() on older GLib versions where g_sort_array() is not
available.
2026-05-03 09:47:31 +02:00
422ee3a14e docs: split legacy GTK+ 2 news into archived NEWS file
Move the historical upstream GTK+ 2.x release notes into
NEWS.pre-2-24-34 and keep NEWS focused on gtk2-ng changes only.

This makes the current NEWS file easier to read for users and
packagers who want to see what changed since the fork, while still
preserving the old upstream GTK+ release history in the repository.
2026-05-03 09:34:45 +02:00
cf910be1d7 statusicon: honor X11 tray icon padding hint
Read _NET_SYSTEM_TRAY_PADDING from the XEmbed tray manager and apply it
as GtkStatusIcon image padding according to the tray orientation.

Default padding remains zero, so behavior is unchanged for tray managers
that do not provide the hint.

Ported-from: Fedora gtk2 icon-padding.patch
2026-05-03 09:34:45 +02:00
90c0c511ab configure: respect configured NM tool
Use AC_CHECK_TOOL for NM so an explicitly configured or cross-prefixed
nm tool can be respected consistently.

Ported-from: Gentoo gtk+-2.24.33-respect-NM.patch
2026-05-03 09:34:45 +02:00
1d462153ef README.md aktualisiert 2026-05-03 07:15:13 +00:00
greenjeans
3cf0715d46 NEWS (#6)
Updated the NEWS file, just the same basically as what's on the readme.md. It's a really long file, do we still need the news from 20 years ago?

Reviewed-on: https://git.devuan.org/Daemonratte/gtk2-ng/pulls/6
Co-authored-by: greenjeans <greenjeans@noreply.localhost>
Co-committed-by: greenjeans <greenjeans@noreply.localhost>
2026-05-02 06:24:18 +00:00
SimplyCEO
93feae9c0b Fixed missing M_PI definition in ANSI C (#7)
Using **Clang 22.1.3** `--std=c89` produces this error.

Reviewed-on: https://git.devuan.org/Daemonratte/gtk2-ng/pulls/7
Co-authored-by: SimplyCEO <simplyceo.developer@gmail.com>
Co-committed-by: SimplyCEO <simplyceo.developer@gmail.com>
2026-05-02 06:20:22 +00:00
MrReplikant
0eff093122 Don't forget the NetBSD bit! (#5)
Reviewed-on: https://git.devuan.org/Daemonratte/gtk2-ng/pulls/5
Co-authored-by: MrReplikant <mrreplikant@noreply.localhost>
Co-committed-by: MrReplikant <mrreplikant@noreply.localhost>
2026-04-30 17:03:48 +00:00
e96b0f5e22 configure: allow disabling optional X11 extensions
Add configure switches for disabling optional X11 extension support:
XRandR, XFixes, XComposite and XDamage.

This allows smaller or more restricted X11 builds without changing the
default behaviour when the libraries are available.

Ported-from: Debian gtk+2.0 005_support_disabling_x11_extensions.patch
2026-04-30 12:20:48 +02:00
cd7eac91d3 updateiconcache: ignore icons from unknown directories
Do not add images from unknown icon-theme directories to the cache.

Files that cannot be associated with a valid icon theme subdirectory
should not be cached with the fallback directory index. Skipping them
avoids listing random images from invalid locations in icon-theme.cache.

Ported-from: Debian gtk+2.0 060_ignore-random-icons.patch
2026-04-30 12:03:08 +02:00
e6434c12f7 mountoperation-x11: add OpenBSD process lookup support
Implement pid_get_parent(), pid_get_env() and pid_get_command_line() for
OpenBSD using sysctl(). This lets GMountOperation::show-processes resolve
process hierarchy, WINDOWID and command line information on OpenBSD
instead of falling back to empty stubs.

Linux keeps using the existing /proc-based implementation, and other
systems keep the previous fallback stubs.

This follows the OpenBSD ports GTK2 patch while dropping obsolete kvm and
fcntl includes that are no longer needed by the sysctl-based code.

Ported-from: OpenBSD ports x11/gtk+2 patch-gtk_gtkmountoperation-x11_c
2026-04-30 11:29:09 +02:00
8ea53af676 build: use a UTF-8 locale for builtin icon cache generation
gtk-update-icon-cache may need to run in a UTF-8 locale when generating
gtkbuiltincache.h. Otherwise GLib can fail to convert UTF-8 output in
ASCII locales such as 646.

Choose a usable UTF-8 locale for this rule, while allowing packagers to
override it with GTK_UPDATE_ICON_CACHE_LOCALE. If no known UTF-8 locale
is available, fall back to the previous behavior.

This is based on the build fix carried by NetBSD pkgsrc for GTK2, but
avoids hard-coding en_US.UTF-8 so Debian, Gentoo, Arch and other systems
can use their available UTF-8 locale.

Ported-from: NetBSD pkgsrc x11/gtk2 patch-gtk_Makefile.in
2026-04-30 11:29:09 +02:00
4c9bbcb03a quartz: support depth-1 images and drawable sources
Allow Quartz GdkImage objects to be created for depth 1 and handle
depth-1 pixel reads and writes using a bit-packed representation for
1-bit image data.

Also stop warning immediately for depth-1 drawable sources in the Quartz
drawable path, allowing matching-depth sources to use the normal image
drawing path.

This is based on the Darwin/Quartz compatibility fix carried by NetBSD
pkgsrc for GTK2 and avoids "Source with depth 1 unsupported" warnings.

Build-tested with the X11 backend; the Quartz-specific path still needs
runtime testing on macOS.

Ported-from: NetBSD pkgsrc x11/gtk2 patch-gdk_quartz_gdkdrawable-quartz.c
Ported-from: NetBSD pkgsrc x11/gtk2 patch-gdk_quartz_gdkimage-quartz.c
2026-04-30 11:29:09 +02:00
a1ab76063d lpr: mark backend printer as accepting PDF and PostScript
Construct the LPR printer with explicit is-virtual, accepts-pdf and
accepts-ps properties so the backend advertises the formats it can
handle.

This follows the GTK2 LPR backend fix referenced by OpenBSD ports and
GNOME, using GTK2's GtkPrinter:is-virtual property name and keeping the
printer non-virtual as in the referenced patch.

Make sure to enable the LPR print backend when using this feature, for
example by setting gtk-print-backends in the user's GTK2 rc file:

    gtk-print-backends = "file,cups,lpr"

For normal application startup, put this setting in ~/.gtkrc-2.0 so GTK2
applications pick it up automatically.

Ported-from: OpenBSD ports x11/gtk+2 patch-modules_printbackends_lpr_gtkprintbackendlpr_c
2026-04-30 11:28:48 +02:00
704fd69781 tooltips: avoid multi-line comments after macros
Keep tooltip delay macro comments on a single line so older
gobject-introspection scanners do not misparse them.

This matches the compatibility fix carried by NetBSD pkgsrc for GTK2,
while keeping the existing private-data modernization unchanged.

Ported-from: NetBSD pkgsrc x11/gtk2 patch-gtk_gtktooltips.c
2026-04-30 10:11:18 +02:00
f615bf1713 build: guard X/Open feature macros
gtkfilesel.c and gtksearchenginesimple.c request X/Open interfaces so
legacy libc declarations such as password database iteration and ftw()
are visible where needed.

Avoid redefining _XOPEN_SOURCE if the build system or compiler already
provided it, and keep the SunOS/C99 guard used by pkgsrc to avoid
exposing incompatible interfaces there.

This preserves the glibc compatibility path while making the feature
test macro handling more portable.

Ported-from: NetBSD pkgsrc x11/gtk2 patch-gtk_gtksearchenginesimple.c
2026-04-30 10:06:26 +02:00
SimplyCEO
0acbe0ce00 Fixed missing standard password file entry functions (#3)
gtkfilesel: expose pwd.h declarations with _XOPEN_SOURCE

gtkfilesel.c uses getpwnam(), setpwent(), getpwent(), and endpwent()
for the old GtkFileSelection home-directory completion code.

Define _XOPEN_SOURCE 500 before including system headers so the pwd.h
declarations are visible.

Problem similar to: 24943c4e7f/gtk/gtksearchenginesimple.c (L30)
Despite having `HAVE_GNU_FTW` set to `1`, `_XOPEN_SOURCE` and `_GNU_SOURCE` are not automatically defined.
But `pwd.h` functions only need `_XOPEN_SOURCE >= 500` defined to work properly.

Reviewed-on: https://git.devuan.org/Daemonratte/gtk2-ng/pulls/3
Co-authored-by: SimplyCEO <simplyceo.developer@gmail.com>
Co-committed-by: SimplyCEO <simplyceo.developer@gmail.com>
2026-04-30 07:41:57 +00:00
d1e8b30d4d build: fix gtktypefuncs parallel build race
gtktypefuncs.c is generated from a temporary source that includes
gtk/gtk.h, so it may depend on generated public GTK headers such as
gtktypebuiltins.h.

Make the rule depend on $(gtk_built_public_sources) to ensure those
headers exist before gtktypefuncs.c is generated. This fixes intermittent
parallel build failures and avoids hard-coding a single generated header.
2026-04-30 09:01:55 +02:00
1503761124 build: make Gtk introspection depend on target library
Gtk-2.0.gir links against the GTK target library through
Gtk_2_0_gir_LIBS, but parallel builds can start g-ir-scanner before the
backend-specific libgtk library has finished linking and before libtool
has created the .libs symlink.

Add an explicit Make dependency from Gtk-2.0.gir to $(gtktargetlib), so
the introspection scanner only runs after the GTK target library has
been built.

This fixes parallel builds with gobject-introspection while keeping the
rule backend-independent for X11, Win32, Quartz and DirectFB.
2026-04-30 08:58:16 +02:00
8d79e7984b updateiconcache: remove invalid temporary cache files
If the generated icon cache fails validation, remove the temporary cache
file before exiting instead of leaving .icon-theme.cache behind.

This matches the cleanup fix carried by FreeBSD ports and NetBSD pkgsrc
for GTK2.

Ported-from: FreeBSD ports x11-toolkits/gtk20
Ported-from: NetBSD pkgsrc x11/gtk2
2026-04-30 08:58:16 +02:00
eb22e06d18 filechooser: guard hidden and backup GFileInfo checks
Avoid querying standard::is-hidden and standard::is-backup through
GFileInfo convenience accessors unless the attributes are present.

This matches fixes carried by OpenBSD ports and NetBSD pkgsrc for GTK2 to
avoid file chooser warnings with recent GLib/GIO, while using GLib's
G_FILE_ATTRIBUTE_STANDARD_* constants for consistency with the existing
gtkfilesystemmodel.c and gtkpathbar.c code.

Ported-from: OpenBSD ports x11/gtk+2
Ported-from: NetBSD pkgsrc x11/gtk2
References: GNOME/gimp#9994
2026-04-30 08:58:16 +02:00
69baadc2b6 README.md aktualisiert 2026-04-30 06:28:37 +00:00
greenjeans
fc76475fd0 README.md (#2)
Add modern README.md with build instructions and project status

Reviewed-on: https://git.devuan.org/Daemonratte/gtk2-ng/pulls/2
Co-authored-by: greenjeans <greenjeans@noreply.localhost>
Co-committed-by: greenjeans <greenjeans@noreply.localhost>
2026-04-30 06:08:36 +00:00
24943c4e7f Fix gtktypefuncs parallel build race 2026-04-29 17:42:54 +02:00
f0d1c05ea9 Fix introspection and test builds with modern toolchains 2026-04-29 17:01:25 +02:00
ac2f760ebf gtk: avoid deprecated GTypeDebugFlags in gtk_type_init 2026-04-29 12:03:47 +02:00
861f9e4f94 build: avoid duplicate MSVC_TOOLSET definition 2026-04-29 09:40:46 +02:00
95560eaef3 build: replace obsolete AC_TRY_LINK_FUNC checks 2026-04-29 09:12:55 +02:00
0b47c812da build: modernize obsolete autoconf macros 2026-04-29 09:12:35 +02:00
c13262edc3 build: replace obsolete AC_TRY_LINK checks 2026-04-29 07:56:58 +02:00