pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/53729: x11/gtk+3 crashes on macOS with quartz backend



>Number:         53729
>Category:       pkg
>Synopsis:       x11/gtk+3 crashes on macOS with quartz backend
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 17 23:55:00 +0000 2018
>Originator:     Jonathan Schleifer
>Release:        HEAD
>Organization:
>Environment:
macOS Mojave
>Description:
x11/gtk+3 crashes on macOS with many apps. The attached patch fixes this.
>How-To-Repeat:
Try running e.g. chat/gajim on macOS.
>Fix:
commit a7f4b30767555cd508f9df334bab285b78aa2d23
Author: Jonathan Schleifer <js%heap.zone@localhost>
Date:   Sun Nov 18 00:36:11 2018 +0100

    Fix x11/gtk+3 crashing on macOS

diff --git a/x11/gtk3/Makefile b/x11/gtk3/Makefile
index 37ac62387e2..3123f938631 100644
--- a/x11/gtk3/Makefile
+++ b/x11/gtk3/Makefile
@@ -2,7 +2,7 @@
 
 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..ce2d483561b 100644
--- a/x11/gtk3/distinfo
+++ b/x11/gtk3/distinfo
@@ -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..d8f4975b303
--- /dev/null
+++ b/x11/gtk3/patches/patch-gdk_quartz_gdkmonitor-quartz.c
@@ -0,0 +1,41 @@
+$NetBSD$
+From 2a392c220d992ba21b1e250be2497248658cfcdb Mon Sep 17 00:00:00 2001
+From: Ignacio Casal Quinteiro <qignacio%amazon.com@localhost>
+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..9550bb72c6f
--- /dev/null
+++ b/x11/gtk3/patches/patch-gdk_quartz_gdkmonitor-quartz.h
@@ -0,0 +1,24 @@
+$NetBSD$
+From 2a392c220d992ba21b1e250be2497248658cfcdb Mon Sep 17 00:00:00 2001
+From: Ignacio Casal Quinteiro <qignacio%amazon.com@localhost>
+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..3ddf0d746df
--- /dev/null
+++ b/x11/gtk3/patches/patch-gdk_quartz_gdkscreen-quartz.c
@@ -0,0 +1,24 @@
+$NetBSD$
+From 2a392c220d992ba21b1e250be2497248658cfcdb Mon Sep 17 00:00:00 2001
+From: Ignacio Casal Quinteiro <qignacio%amazon.com@localhost>
+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];
+ 



Home | Main Index | Thread Index | Old Index