[gtk-osx] Update Gtk+ to current repo state for macOS in prep for Gramps Build.



commit 07cbd8826e149d5c195b8fc4eb879bfafc1a8a90
Author: John Ralls <jralls ceridwen us>
Date:   Thu Jul 1 11:27:16 2021 -0700

    Update Gtk+ to current repo state for macOS in prep for Gramps Build.

 modulesets-stable/gtk-osx.modules                 |  7 +-
 patches/gtk3-24-29-Fix-macos-max-allowed.patch    | 25 ++++++
 patches/gtk3-24-29-build-on-Yosemite.patch        | 46 +++++++++++
 patches/gtk3-24-29-ensure-drag-source-freed.patch | 99 +++++++++++++++++++++++
 4 files changed, 175 insertions(+), 2 deletions(-)
---
diff --git a/modulesets-stable/gtk-osx.modules b/modulesets-stable/gtk-osx.modules
index 05b1131e..3aa718f3 100644
--- a/modulesets-stable/gtk-osx.modules
+++ b/modulesets-stable/gtk-osx.modules
@@ -288,8 +288,11 @@
   <!-- gtk3 is in maintenance mode with 3.24 the final release series. -->
   <meson id="gtk+-3.0"
              mesonargs="-Dquartz-backend=true -Dx11-backend=false -Dmedia=none">
-    <branch module="gtk+/3.24/gtk+-3.24.28.tar.xz" version="3.24.28"
-            hash="sha256:b04e09763367f1ce932cd2ee3a359d4de150e1c38e7bef7d29aa72557a6b47c6">
+    <branch module="gtk+/3.24/gtk+-3.24.29.tar.xz" version="3.24.29"
+            hash="sha256:f57ec4ade8f15cab0c23a80dcaee85b876e70a8823d9105f067ce335a8268caa">
+      <patch file="gtk-3-24-29-ensure-drag-source-freed.patch" strip="1"/>
+      <patch file="gtk3-24-29-Fix-macos-max-allowed.patch" strip="1"/>
+      <patch file="gtk3-24-29-build-on-Yosemite.patch" strip="1"/>
     </branch>
     <dependencies>
       <dep package="glib"/>
diff --git a/patches/gtk3-24-29-Fix-macos-max-allowed.patch b/patches/gtk3-24-29-Fix-macos-max-allowed.patch
new file mode 100644
index 00000000..6bccb2ca
--- /dev/null
+++ b/patches/gtk3-24-29-Fix-macos-max-allowed.patch
@@ -0,0 +1,25 @@
+From 0e14822a22728cdc6ee3e77b63bfef4a11ae92bc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mos=C3=A8=20Giordano?= <mose gnu org>
+Date: Fri, 7 May 2021 11:46:47 +0100
+Subject: [PATCH] Fix value of `MAC_OS_X_VERSION_MAX_ALLOWED`
+
+---
+ gdk/quartz/gdkwindow-quartz.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
+index 5b454341df..14711e7d8e 100644
+--- a/gdk/quartz/gdkwindow-quartz.c
++++ b/gdk/quartz/gdkwindow-quartz.c
+@@ -2228,7 +2228,7 @@ _gdk_quartz_window_set_collection_behavior (NSWindow *nswindow,
+                                             GdkWindowTypeHint hint)
+ {
+ #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 10110
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101100
+ #define GDK_QUARTZ_ALLOWS_TILING NSWindowCollectionBehaviorFullScreenAllowsTiling
+ #define GDK_QUARTZ_DISALLOWS_TILING NSWindowCollectionBehaviorFullScreenDisallowsTiling
+ #else
+-- 
+2.30.1 (Apple Git-130)
+
diff --git a/patches/gtk3-24-29-build-on-Yosemite.patch b/patches/gtk3-24-29-build-on-Yosemite.patch
new file mode 100644
index 00000000..8a38d3e2
--- /dev/null
+++ b/patches/gtk3-24-29-build-on-Yosemite.patch
@@ -0,0 +1,46 @@
+From 66b533408d6a7a9e3f00138403ea88b9ddb4b303 Mon Sep 17 00:00:00 2001
+From: Tom Schoonjans <Tom Schoonjans rfi ac uk>
+Date: Wed, 9 Jun 2021 16:35:31 +0100
+Subject: [PATCH] quartz: fix compilation on macOS 10.10
+
+---
+ gdk/quartz/gdkinternal-quartz.h | 6 +-----
+ gdk/quartz/gdkwindow-quartz.c   | 2 +-
+ 2 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/gdk/quartz/gdkinternal-quartz.h b/gdk/quartz/gdkinternal-quartz.h
+index 271137171b..ec4a2c1c3b 100644
+--- a/gdk/quartz/gdkinternal-quartz.h
++++ b/gdk/quartz/gdkinternal-quartz.h
+@@ -79,14 +79,10 @@ typedef enum {
+ #define GDK_QUARTZ_EVENT_TABLET_PROXIMITY NSEventTypeTabletProximity
+ #define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY NSEventSubtypeTabletProximity
+ #define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT NSEventSubtypeTabletPoint
+-#elif MAC_OS_X_VERSION_MIN_REQUIRED >= 10120
++#else
+ #define GDK_QUARTZ_EVENT_TABLET_PROXIMITY NSTabletProximity
+ #define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY NSTabletProximityEventSubtype
+ #define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT NSTabletPointEventSubtype
+-#else
+-#define GDK_QUARTZ_EVENT_TABLET_PROXIMITY kEventTabletProximity
+-#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY NSTabletProximityEventSubtype
+-#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT kCGEventMouseSubtypeTabletPoint
+ #endif
+ 
+ void         _gdk_quartz_events_update_focus_window    (GdkWindow *new_window,
+diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
+index 14711e7d8e..cb61aeb2f7 100644
+--- a/gdk/quartz/gdkwindow-quartz.c
++++ b/gdk/quartz/gdkwindow-quartz.c
+@@ -2228,7 +2228,7 @@ _gdk_quartz_window_set_collection_behavior (NSWindow *nswindow,
+                                             GdkWindowTypeHint hint)
+ {
+ #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101100
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
+ #define GDK_QUARTZ_ALLOWS_TILING NSWindowCollectionBehaviorFullScreenAllowsTiling
+ #define GDK_QUARTZ_DISALLOWS_TILING NSWindowCollectionBehaviorFullScreenDisallowsTiling
+ #else
+-- 
+2.30.1 (Apple Git-130)
+
diff --git a/patches/gtk3-24-29-ensure-drag-source-freed.patch 
b/patches/gtk3-24-29-ensure-drag-source-freed.patch
new file mode 100644
index 00000000..477bcaaa
--- /dev/null
+++ b/patches/gtk3-24-29-ensure-drag-source-freed.patch
@@ -0,0 +1,99 @@
+From a6c3887736a34b669e7d8176e3e47a8f1f9f1e4a Mon Sep 17 00:00:00 2001
+From: John Ralls <jralls ceridwen us>
+Date: Sun, 25 Apr 2021 16:53:15 -0700
+Subject: [PATCH] Ensure gdk_quartz_drag_source freed on all paths.
+
+New release function _gdk_quartz_drag_source_context_destroy_gtk_only
+gets called when drag fails to start or is cancelled as well as
+when it successfully completes.
+---
+ gdk/quartz/GdkQuartzNSWindow.c | 3 +--
+ gdk/quartz/gdkdnd-quartz.c     | 8 ++++++++
+ gdk/quartz/gdkquartzdnd.h      | 3 +++
+ gtk/gtkdnd-quartz.c            | 9 ++++++---
+ 4 files changed, 18 insertions(+), 5 deletions(-)
+
+diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c
+index 005e747d94..f0e57434f4 100644
+--- a/gdk/quartz/GdkQuartzNSWindow.c
++++ b/gdk/quartz/GdkQuartzNSWindow.c
+@@ -803,8 +803,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
+ 
+   gdk_event_free (event);
+ 
+-  g_object_unref (_gdk_quartz_drag_source_context);
+-  _gdk_quartz_drag_source_context = NULL;
++  _gdk_quartz_drag_source_context_destroy_gtk_only ();
+ }
+ 
+ #ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
+diff --git a/gdk/quartz/gdkdnd-quartz.c b/gdk/quartz/gdkdnd-quartz.c
+index a68ee3055e..a16e67187a 100644
+--- a/gdk/quartz/gdkdnd-quartz.c
++++ b/gdk/quartz/gdkdnd-quartz.c
+@@ -59,6 +59,14 @@ _gdk_quartz_window_drag_begin (GdkWindow *window,
+   return _gdk_quartz_drag_source_context;
+ }
+ 
++void
++_gdk_quartz_drag_source_context_destroy_gtk_only ()
++{
++     if (_gdk_quartz_drag_source_context)
++          g_object_unref (_gdk_quartz_drag_source_context);
++     _gdk_quartz_drag_source_context = NULL;
++}
++
+ static gboolean
+ gdk_quartz_drag_context_drag_motion (GdkDragContext  *context,
+                                      GdkWindow       *dest_window,
+diff --git a/gdk/quartz/gdkquartzdnd.h b/gdk/quartz/gdkquartzdnd.h
+index bdcc93a12d..c14d99630d 100644
+--- a/gdk/quartz/gdkquartzdnd.h
++++ b/gdk/quartz/gdkquartzdnd.h
+@@ -51,6 +51,9 @@ id        gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext
+ GDK_AVAILABLE_IN_ALL
+ GdkDragContext *gdk_quartz_drag_source_context_libgtk_only (void);
+ 
++GDK_AVAILABLE_IN_3_24
++void _gdk_quartz_drag_source_context_destroy_gtk_only ();
++
+ G_END_DECLS
+ 
+ #endif /* __GDK_QUARTZ_DRAG_CONTEXT_H__ */
+diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
+index 959e90d930..3460de6edd 100644
+--- a/gtk/gtkdnd-quartz.c
++++ b/gtk/gtkdnd-quartz.c
+@@ -1088,8 +1088,10 @@ gtk_drag_begin_idle (gpointer arg)
+   [types release];
+ 
+   if ((nswindow = get_toplevel_nswindow (info->source_widget)) == NULL)
+-     return G_SOURCE_REMOVE;
+-  
++    {
++      _gdk_quartz_drag_source_context_destroy_gtk_only ();
++      return G_SOURCE_REMOVE;
++    }
+   /* Ref the context. It's unreffed when the drag has been aborted */
+   g_object_ref (info->context);
+ 
+@@ -1101,6 +1103,7 @@ gtk_drag_begin_idle (gpointer arg)
+   if (drag_image == NULL)
+     {
+       g_object_unref (info->context);
++      _gdk_quartz_drag_source_context_destroy_gtk_only ();
+       return G_SOURCE_REMOVE;
+     }
+ 
+@@ -1669,7 +1672,7 @@ _gtk_drag_source_handle_event (GtkWidget *widget,
+       break;
+     default:
+       g_assert_not_reached ();
+-    }  
++    }
+ }
+ 
+ /**
+-- 
+2.30.1 (Apple Git-130)
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]