pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/x11/gtk2
Module Name: pkgsrc
Committed By: pho
Date: Tue Aug 26 04:36:17 UTC 2025
Modified Files:
pkgsrc/x11/gtk2: Makefile distinfo
Added Files:
pkgsrc/x11/gtk2/patches: patch-gdk_quartz_gdkdrawable-quartz.c
patch-gdk_quartz_gdkimage-quartz.c
Log Message:
x11/gtk2: Fix rendering issues on Darwin/Quartz
To generate a diff of this commit:
cvs rdiff -u -r1.358 -r1.359 pkgsrc/x11/gtk2/Makefile
cvs rdiff -u -r1.172 -r1.173 pkgsrc/x11/gtk2/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/x11/gtk2/patches/patch-gdk_quartz_gdkdrawable-quartz.c \
pkgsrc/x11/gtk2/patches/patch-gdk_quartz_gdkimage-quartz.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/x11/gtk2/Makefile
diff -u pkgsrc/x11/gtk2/Makefile:1.358 pkgsrc/x11/gtk2/Makefile:1.359
--- pkgsrc/x11/gtk2/Makefile:1.358 Sat Jul 19 05:37:49 2025
+++ pkgsrc/x11/gtk2/Makefile Tue Aug 26 04:36:17 2025
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.358 2025/07/19 05:37:49 wiz Exp $
+# $NetBSD: Makefile,v 1.359 2025/08/26 04:36:17 pho Exp $
DISTNAME= gtk+-2.24.33
PKGNAME= ${DISTNAME:S/gtk/gtk2/}
-PKGREVISION= 31
+PKGREVISION= 32
CATEGORIES= x11 gnome
MASTER_SITES= ${MASTER_SITE_GNOME:=sources/gtk+/2.24/}
EXTRACT_SUFX= .tar.xz
Index: pkgsrc/x11/gtk2/distinfo
diff -u pkgsrc/x11/gtk2/distinfo:1.172 pkgsrc/x11/gtk2/distinfo:1.173
--- pkgsrc/x11/gtk2/distinfo:1.172 Wed Feb 12 05:07:23 2025
+++ pkgsrc/x11/gtk2/distinfo Tue Aug 26 04:36:17 2025
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.172 2025/02/12 05:07:23 rillig Exp $
+$NetBSD: distinfo,v 1.173 2025/08/26 04:36:17 pho Exp $
BLAKE2s (gtk+-2.24.33.tar.xz) = 358ff13c5e021a4634bc5944474c0818181d56cff55473d911a4afb42d5d81fb
SHA512 (gtk+-2.24.33.tar.xz) = 71b588797c81f727dfac8dcb1be193f7436f717d30ecf18eae2d3aeb0f445b3be4743400acac16435490db8f564f01032065d3f42d27871317f80c98aef929d5
@@ -6,6 +6,8 @@ Size (gtk+-2.24.33.tar.xz) = 12661828 by
SHA1 (patch-ab) = 9c82cc60f3825d377a197c876fcc6faa379cbde3
SHA1 (patch-af) = d59414e24a7da7f8694dbefbd2f0c2c2b60ec5ad
SHA1 (patch-aj) = 9887573ac7ade9e8f8ee2ead68e279f67836a1a3
+SHA1 (patch-gdk_quartz_gdkdrawable-quartz.c) = 4bda4ee6d45472e56d0551e19821947fafaa840d
+SHA1 (patch-gdk_quartz_gdkimage-quartz.c) = 1b1d673249720975778a11d0ff49b4e60b924c9f
SHA1 (patch-gtk_Makefile.in) = 354b61b7bde7105f065d0d97283e09002e9a0dbf
SHA1 (patch-gtk_gtkfilechooserdefault.c) = f690f3a8c3066e49e8184fb096f5dd74e5a93f33
SHA1 (patch-gtk_gtkfilesystemmodel.c) = 5a70efa956be67b8d9b4a5b79147003988c4befd
Added files:
Index: pkgsrc/x11/gtk2/patches/patch-gdk_quartz_gdkdrawable-quartz.c
diff -u /dev/null pkgsrc/x11/gtk2/patches/patch-gdk_quartz_gdkdrawable-quartz.c:1.1
--- /dev/null Tue Aug 26 04:36:17 2025
+++ pkgsrc/x11/gtk2/patches/patch-gdk_quartz_gdkdrawable-quartz.c Tue Aug 26 04:36:17 2025
@@ -0,0 +1,22 @@
+$NetBSD: patch-gdk_quartz_gdkdrawable-quartz.c,v 1.1 2025/08/26 04:36:17 pho Exp $
+
+Fix "Source with depth 1 unsupported" warnings on Darwin/Quartz.
+- Upstream ticket: https://gitlab.gnome.org/GNOME/gtk/-/issues/580
+- Patch from: https://trac.macports.org/ticket/69291
+
+--- gdk/quartz/gdkdrawable-quartz.c.orig 2020-12-18 05:50:58.000000000 +0000
++++ gdk/quartz/gdkdrawable-quartz.c
+@@ -462,12 +462,7 @@ gdk_quartz_draw_drawable (GdkDrawable *d
+ }
+
+ /* Handle drawable and pixmap sources. */
+- if (src_depth == 1)
+- {
+- /* FIXME: src depth 1 is not supported yet */
+- g_warning ("Source with depth 1 unsupported");
+- }
+- else if (dest_depth != 0 && src_depth == dest_depth)
++ if (dest_depth != 0 && src_depth == dest_depth)
+ {
+ GdkPixmapImplQuartz *pixmap_impl = GDK_PIXMAP_IMPL_QUARTZ (src_impl);
+ CGContextRef context = gdk_quartz_drawable_get_context (drawable, FALSE);
Index: pkgsrc/x11/gtk2/patches/patch-gdk_quartz_gdkimage-quartz.c
diff -u /dev/null pkgsrc/x11/gtk2/patches/patch-gdk_quartz_gdkimage-quartz.c:1.1
--- /dev/null Tue Aug 26 04:36:17 2025
+++ pkgsrc/x11/gtk2/patches/patch-gdk_quartz_gdkimage-quartz.c Tue Aug 26 04:36:17 2025
@@ -0,0 +1,125 @@
+$NetBSD: patch-gdk_quartz_gdkimage-quartz.c,v 1.1 2025/08/26 04:36:17 pho Exp $
+
+Fix "Source with depth 1 unsupported" warnings on Darwin/Quartz.
+- Upstream ticket: https://gitlab.gnome.org/GNOME/gtk/-/issues/580
+- Patch from: https://trac.macports.org/ticket/69291
+
+--- gdk/quartz/gdkimage-quartz.c.orig 2020-12-18 05:29:39.000000000 +0000
++++ gdk/quartz/gdkimage-quartz.c
+@@ -37,15 +37,16 @@ _gdk_quartz_image_copy_to_image (GdkDraw
+ gint height)
+ {
+ GdkScreen *screen;
++ int depth;
+
+ g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_QUARTZ (drawable), NULL);
+ g_return_val_if_fail (image != NULL || (dest_x == 0 && dest_y == 0), NULL);
+
+ screen = gdk_drawable_get_screen (drawable);
++ depth = gdk_drawable_get_depth (drawable);
+ if (!image)
+ image = _gdk_image_new_for_depth (screen, GDK_IMAGE_FASTEST, NULL,
+- width, height,
+- gdk_drawable_get_depth (drawable));
++ width, height, depth);
+
+ if (GDK_IS_PIXMAP_IMPL_QUARTZ (drawable))
+ {
+@@ -63,7 +64,7 @@ _gdk_quartz_image_copy_to_image (GdkDraw
+ return image;
+ }
+
+- switch (gdk_drawable_get_depth (drawable))
++ switch (depth)
+ {
+ case 24:
+ bytes_per_row = pix_impl->width * 4;
+@@ -123,7 +124,7 @@ _gdk_quartz_image_copy_to_image (GdkDraw
+ break;
+
+ default:
+- g_warning ("Unsupported bit depth %d\n", gdk_drawable_get_depth (drawable));
++ g_warning ("Unsupported bit depth %d\n", depth);
+ return image;
+ }
+ }
+@@ -322,7 +323,7 @@ _gdk_image_new_for_depth (GdkScreen *
+ if (visual)
+ depth = visual->depth;
+
+- g_assert (depth == 24 || depth == 32);
++ g_assert (depth == 1 || depth == 24 || depth == 32);
+
+ image = g_object_new (gdk_image_get_type (), NULL);
+ image->type = type;
+@@ -333,11 +334,16 @@ _gdk_image_new_for_depth (GdkScreen *
+
+ image->byte_order = (G_BYTE_ORDER == G_LITTLE_ENDIAN) ? GDK_LSB_FIRST : GDK_MSB_FIRST;
+
+- /* We only support images with bpp 4 */
+- image->bpp = 4;
+- image->bpl = image->width * image->bpp;
+- image->bits_per_pixel = image->bpp * 8;
+-
++ if (depth == 1) {
++ image->bpp = 1;
++ image->bpl = (image->width >> 3) + 1;
++ image->bits_per_pixel = 1;
++ } else {
++ image->bpp = 4;
++ image->bpl = image->width * image->bpp;
++ image->bits_per_pixel = image->bpp * 8;
++ }
++
+ image->mem = g_malloc (image->bpl * image->height);
+ memset (image->mem, 0x00, image->bpl * image->height);
+
+@@ -355,7 +361,14 @@ gdk_image_get_pixel (GdkImage *image,
+ g_return_val_if_fail (x >= 0 && x < image->width, 0);
+ g_return_val_if_fail (y >= 0 && y < image->height, 0);
+
+- ptr = image->mem + y * image->bpl + x * image->bpp;
++ ptr = image->mem + y * image->bpl;
++ if (image->depth == 1) {
++ guchar data = (image->byte_order == GDK_MSB_FIRST ? (0x80 >> (x & 7)) : (1 << (x & 7)));
++ return (ptr[x >> 3] & data) ? 0x1 : 0x0;
++ } else {
++ ptr += x * image->bpp;
++ return *(guint32 *)ptr;
++ }
+
+ return *(guint32 *)ptr;
+ }
+@@ -366,9 +379,18 @@ gdk_image_put_pixel (GdkImage *image,
+ gint y,
+ guint32 pixel)
+ {
+- guchar *ptr;
+-
+- ptr = image->mem + y * image->bpl + x * image->bpp;
++ guchar *ptr = image->mem + y * image->bpl;
++ if (image->depth == 1) {
++ guchar data = (image->byte_order == GDK_MSB_FIRST ? (0x80 >> (x & 7)) : (1 << (x & 7)));
++ if (pixel) {
++ ptr[x >> 3] |= data;
++ } else {
++ ptr[x >> 3] &= ~data;
++ }
++ } else {
++ ptr += x * image->bpp;
++ *(guint32 *)ptr = pixel;
++ }
+
+ *(guint32 *)ptr = pixel;
+ }
+@@ -377,7 +399,9 @@ gint
+ _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
+ gint depth)
+ {
+- if (depth == 24 || depth == 32)
++ if (depth == 1)
++ return 1;
++ else if (depth == 24 || depth == 32)
+ return 32;
+ else
+ g_assert_not_reached ();
Home |
Main Index |
Thread Index |
Old Index