Commit graph

22,212 commits

Author SHA1 Message Date
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
1efebc9a21 build: modernize libtool initialization and drop AC_ISC_POSIX 2026-04-29 07:48:03 +02:00
a6756010ae configure: replace obsolete AC_HELP_STRING 2026-04-28 21:55:12 +02:00
4716be1ebc Replace obsolete AC_LANG_CPLUSPLUS and AC_TRY_COMPILE uses in the C++
compiler checks with AC_LANG_PUSH/POP and AC_COMPILE_IFELSE.

This keeps the existing behavior of disabling HAVE_CXX when the compiler
test fails, while avoiding obsolete Autoconf macro warnings.
2026-04-28 21:53:14 +02:00
0329bdbd7c gtk-doc.make defines EXTRA_DIST for gtk-doc reference manuals. Including
the shared Makefile.decl in the same Makefile.am also initializes
EXTRA_DIST, which causes duplicate definition warnings with newer
Automake.

Keep the global EXTRA_DIST initialization for ordinary Makefile.am files
that append to it, but avoid including Makefile.decl in the gtk-doc
reference Makefiles.
2026-04-28 21:47:11 +02:00
f49240f508 build: avoid duplicate EXTRA_DIST definition 2026-04-28 21:40:34 +02:00
a5b0a22195 configure: modernize ANSI prototype run test 2026-04-28 21:34:45 +02:00
bfb1541c33 tests: comment out variables for disabled tests 2026-04-28 21:30:15 +02:00
b1fdc9cddd docs: avoid duplicate html and pdf targets
Automake warns when html and pdf targets are defined separately in both
branches of the HAVE_DOCBOOK conditional.

Define the public html and pdf targets once and dispatch to DocBook or
non-DocBook helper targets instead. This preserves the existing behavior
while avoiding duplicate target warnings with newer Automake.
2026-04-28 21:22:03 +02:00
81b9e0200f build: replace deprecated INCLUDES with AM_CPPFLAGS 2026-04-28 21:14:00 +02:00
97aac40bd2 autogen: copy generated helper files 2026-04-28 21:13:55 +02:00
6b9adf5765 build: use Automake foreign mode
Set Automake's foreign mode so bootstrapping no longer requires GNU
package files such as README to exist as plain files. This removes the
need for autogen.sh to create placeholder README and INSTALL files before
running automake.
2026-04-28 20:07:24 +02:00
c81e7bb652 Add gtkpixdatautils.h to Makefile 2026-04-28 19:58:05 +02:00
d231a62ad8 autogen: avoid hard-coded libtool and automake version limits
Do not reject newer libtool releases only because they are not listed in
autogen.sh. Also make automake detection more future-proof by trying
known versioned automake/aclocal binaries first, then falling back to the
unversioned tools.

Validate user-provided AUTOMAKE and ACLOCAL values early, so bootstrap
failures report a clear error instead of failing later during generation.

This allows systems with newer toolchains, such as Gentoo with libtool
2.5.x and Automake 1.18, to bootstrap the build without local edits.
2026-04-28 19:47:27 +02:00
c674cf997f Use shared pixdata helper in update-icon-cache
Replace deprecated GdkPixdata serialization in gtk-update-icon-cache with
the shared internal pixdata helper.

Keep writing the existing type 0 GdkP pixdata stream format so generated
icon cache files remain compatible, while avoiding deprecated
gdk_pixdata_from_pixbuf() and gdk_pixdata_serialize().

Build gtkpixdatautils.c into gtk-update-icon-cache with target-specific
CFLAGS so Automake uses separate object names for the standalone tool.
2026-04-28 18:56:08 +02:00
adf1cd3565 Fix stock item grouping in toolpalette demo
Do not assume that stock item ids can be grouped by id[4] with only four
exact starting letters. Strip the gtk- prefix and group by the first stock
name character range instead.

This keeps all stock items in a valid GtkToolItemGroup and avoids criticals
when opening the toolpalette demo.
2026-04-28 18:11:36 +02:00
8d40b78db4 Use shared pixdata helper for item factory images
Replace the deprecated gdk_pixbuf_new_from_inline() call used for item
factory image menu items with the internal pixdata helper.

Keep the existing inline extra_data handling and lazy pixbuf creation while
avoiding deprecated GdkPixbuf inline loading.
2026-04-28 17:55:33 +02:00
c2db5954c4 Use shared pixdata helper for drag cursors
Replace the deprecated gdk_pixbuf_new_from_inline() call used for GTK drag
cursor pixbufs with the internal pixdata helper.

Keep the existing embedded cursor data and lazy per-cursor pixbuf creation.
The helper reads the embedded pixdata length from the stream header and then
uses the shared validating decoder, avoiding extra per-cursor metadata or
runtime resources.
2026-04-28 17:22:24 +02:00
3cf7eeb869 Use shared pixdata helpers in text buffer serialization
Replace the deprecated GdkPixdata serialize, deserialize and from-pixdata
calls in GtkTextBuffer rich text serialization with the internal pixdata
helper functions.

Keep the existing GTKTEXTBUFFERPIXBDATA-0001 section format and continue to
read the old embedded GdkP pixdata stream representation. New serialized
pixbuf data is written as the same pixdata stream format without introducing
runtime files, resources or ABI changes.
2026-04-28 17:11:47 +02:00