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.
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.
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.
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.
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.
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.
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
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
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>
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
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
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
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
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
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
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
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
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>
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.
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.
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
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
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>