diff options
author | maya <maya@pkgsrc.org> | 2018-11-20 08:13:56 +0000 |
---|---|---|
committer | maya <maya@pkgsrc.org> | 2018-11-20 08:13:56 +0000 |
commit | ce635def3cf80e5cc8e6b46dc7e3bbc8dbe4b589 (patch) | |
tree | 3c66f76e41713e0af8bd128aaae89f2840ac0441 /x11/gtk3 | |
parent | 128e2f895752f3fc281fed98d0bd8078f178933b (diff) | |
download | pkgsrc-ce635def3cf80e5cc8e6b46dc7e3bbc8dbe4b589.tar.gz |
gtk3: backport upstream commit to fix crashes on macOS
From Jonathan Schleifer in PR pkg/53729
Diffstat (limited to 'x11/gtk3')
-rw-r--r-- | x11/gtk3/Makefile | 4 | ||||
-rw-r--r-- | x11/gtk3/distinfo | 5 | ||||
-rw-r--r-- | x11/gtk3/patches/patch-gdk_quartz_gdkmonitor-quartz.c | 41 | ||||
-rw-r--r-- | x11/gtk3/patches/patch-gdk_quartz_gdkmonitor-quartz.h | 24 | ||||
-rw-r--r-- | x11/gtk3/patches/patch-gdk_quartz_gdkscreen-quartz.c | 24 |
5 files changed, 95 insertions, 3 deletions
diff --git a/x11/gtk3/Makefile b/x11/gtk3/Makefile index 37ac62387e2..1673b707564 100644 --- a/x11/gtk3/Makefile +++ b/x11/gtk3/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.122 2018/11/14 22:22:42 kleink Exp $ +# $NetBSD: Makefile,v 1.123 2018/11/20 08:13:56 maya Exp $ DISTNAME= gtk+-3.24.1 PKGNAME= ${DISTNAME:S/gtk/gtk3/} -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= x11 gnome MASTER_SITES= ${MASTER_SITE_GNOME:=sources/gtk+/${PKGVERSION_NOREV:R}/} EXTRACT_SUFX= .tar.xz diff --git a/x11/gtk3/distinfo b/x11/gtk3/distinfo index 34fa65957fe..7a96865f32d 100644 --- a/x11/gtk3/distinfo +++ b/x11/gtk3/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.59 2018/10/30 17:49:37 leot Exp $ +$NetBSD: distinfo,v 1.60 2018/11/20 08:13:56 maya Exp $ SHA1 (gtk+-3.24.1.tar.xz) = 0a5ce28ba6065a484308093bdb56ff6056b0db3c RMD160 (gtk+-3.24.1.tar.xz) = f1e26685ff6a267ad0a81e0f8dd06112b6a5a5b8 @@ -8,6 +8,9 @@ SHA1 (patch-aj) = cbfab43f27352f7c6bc57a7c562c2d84c69da07a SHA1 (patch-config.h.in) = dc5f8741eed554f88c0b6834cadad95083e4dc8f SHA1 (patch-configure) = d531b33e52facf960058f1223b70db680da35300 SHA1 (patch-configure.ac) = 68793f40752f25ccaecc958c72c23a504670bea5 +SHA1 (patch-gdk_quartz_gdkmonitor-quartz.c) = a35b7ed5de20ae5d4586c1c09dbc39fe50b8c726 +SHA1 (patch-gdk_quartz_gdkmonitor-quartz.h) = 4b54b2a4a2ff5758520b5e25545b277e3ca4b767 +SHA1 (patch-gdk_quartz_gdkscreen-quartz.c) = 4bcbbc0afc7966b8b6c3110cd2af3ab61685a0a0 SHA1 (patch-gdk_x11_gdkscreen-x11.h) = 455d6c3de8421984ba3c99baf51cd31982a3df78 SHA1 (patch-gdk_x11_gdkwindow-x11.h) = c80f7c9d5a570817e54fd74fa903a53400dc6f64 SHA1 (patch-gtk_a11y_gtkaccessibility.c) = 13232c85bd570f21ea03153dacde4ca98c7c76a8 diff --git a/x11/gtk3/patches/patch-gdk_quartz_gdkmonitor-quartz.c b/x11/gtk3/patches/patch-gdk_quartz_gdkmonitor-quartz.c new file mode 100644 index 00000000000..97b2a3c6017 --- /dev/null +++ b/x11/gtk3/patches/patch-gdk_quartz_gdkmonitor-quartz.c @@ -0,0 +1,41 @@ +$NetBSD: patch-gdk_quartz_gdkmonitor-quartz.c,v 1.1 2018/11/20 08:13:56 maya Exp $ +From 2a392c220d992ba21b1e250be2497248658cfcdb Mon Sep 17 00:00:00 2001 +From: Ignacio Casal Quinteiro <qignacio@amazon.com> +Date: Sun, 7 Oct 2018 21:51:35 +0200 +Subject: [PATCH] quartz: do not cache the screen in the gdkmonitor + +Instead we just cache the monitor number and get +out of it the nsscreen when it is needed. This is +a requirement since it nsscreen it is not supposed +to be cached. + +Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1312 + +--- gdk/quartz/gdkmonitor-quartz.c.orig 2018-11-17 23:32:33.000000000 +0000 ++++ gdk/quartz/gdkmonitor-quartz.c +@@ -35,12 +35,19 @@ gdk_quartz_monitor_get_workarea (GdkMoni + + GDK_QUARTZ_ALLOC_POOL; + +- NSRect rect = [quartz_monitor->nsscreen visibleFrame]; +- +- dest->x = rect.origin.x - quartz_screen->min_x; +- dest->y = quartz_screen->height - (rect.origin.y + rect.size.height) + quartz_screen->min_y; +- dest->width = rect.size.width; +- dest->height = rect.size.height; ++ NSArray *array = [NSScreen screens]; ++ if (quartz_monitor->monitor_num < [array count]) ++ { ++ NSScreen *screen = [array objectAtIndex:quartz_monitor->monitor_num]; ++ NSRect rect = [screen visibleFrame]; ++ ++ dest->x = rect.origin.x - quartz_screen->min_x; ++ dest->y = quartz_screen->height - (rect.origin.y + rect.size.height) + quartz_screen->min_y; ++ dest->width = rect.size.width; ++ dest->height = rect.size.height; ++ } ++ else ++ *dest = monitor->geometry; + + GDK_QUARTZ_RELEASE_POOL; + } diff --git a/x11/gtk3/patches/patch-gdk_quartz_gdkmonitor-quartz.h b/x11/gtk3/patches/patch-gdk_quartz_gdkmonitor-quartz.h new file mode 100644 index 00000000000..a0dcaa75ebd --- /dev/null +++ b/x11/gtk3/patches/patch-gdk_quartz_gdkmonitor-quartz.h @@ -0,0 +1,24 @@ +$NetBSD: patch-gdk_quartz_gdkmonitor-quartz.h,v 1.1 2018/11/20 08:13:56 maya Exp $ +From 2a392c220d992ba21b1e250be2497248658cfcdb Mon Sep 17 00:00:00 2001 +From: Ignacio Casal Quinteiro <qignacio@amazon.com> +Date: Sun, 7 Oct 2018 21:51:35 +0200 +Subject: [PATCH] quartz: do not cache the screen in the gdkmonitor + +Instead we just cache the monitor number and get +out of it the nsscreen when it is needed. This is +a requirement since it nsscreen it is not supposed +to be cached. + +Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1312 + +--- gdk/quartz/gdkmonitor-quartz.h.orig 2018-11-17 23:32:33.000000000 +0000 ++++ gdk/quartz/gdkmonitor-quartz.h +@@ -30,7 +30,7 @@ struct _GdkQuartzMonitor + { + GdkMonitor parent; + +- NSScreen *nsscreen; ++ gint monitor_num; + }; + + struct _GdkQuartzMonitorClass { diff --git a/x11/gtk3/patches/patch-gdk_quartz_gdkscreen-quartz.c b/x11/gtk3/patches/patch-gdk_quartz_gdkscreen-quartz.c new file mode 100644 index 00000000000..d903fc0b63d --- /dev/null +++ b/x11/gtk3/patches/patch-gdk_quartz_gdkscreen-quartz.c @@ -0,0 +1,24 @@ +$NetBSD: patch-gdk_quartz_gdkscreen-quartz.c,v 1.1 2018/11/20 08:13:56 maya Exp $ +From 2a392c220d992ba21b1e250be2497248658cfcdb Mon Sep 17 00:00:00 2001 +From: Ignacio Casal Quinteiro <qignacio@amazon.com> +Date: Sun, 7 Oct 2018 21:51:35 +0200 +Subject: [PATCH] quartz: do not cache the screen in the gdkmonitor + +Instead we just cache the monitor number and get +out of it the nsscreen when it is needed. This is +a requirement since it nsscreen it is not supposed +to be cached. + +Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1312 + +--- gdk/quartz/gdkscreen-quartz.c.orig 2018-11-17 23:32:33.000000000 +0000 ++++ gdk/quartz/gdkscreen-quartz.c +@@ -156,7 +156,7 @@ gdk_quartz_screen_calculate_layout (GdkQ + "display", display, + NULL); + g_ptr_array_add (display_quartz->monitors, monitor); +- monitor->nsscreen = [array objectAtIndex:i]; ++ monitor->monitor_num = i; + + NSRect rect = [[array objectAtIndex:i] frame]; + |