[gtk-osx] Patch gtk-mac-integration crash



commit fbe2c39f26d0534c43b94cffc3fdf8e538f01c0c
Author: John Ralls <jralls ceridwen us>
Date:   Mon Dec 30 12:27:09 2013 -0800

    Patch gtk-mac-integration  crash

 modulesets-stable/gtk-osx-python.modules           |    4 ++-
 ...ed-exception-from-attempting-to-access-me.patch |   39 ++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletions(-)
---
diff --git a/modulesets-stable/gtk-osx-python.modules b/modulesets-stable/gtk-osx-python.modules
index 688c643..6fc0c47 100644
--- a/modulesets-stable/gtk-osx-python.modules
+++ b/modulesets-stable/gtk-osx-python.modules
@@ -201,7 +201,9 @@
              autogenargs="--enable-python">
     <branch module="gtk-mac-integration/2.0/gtk-mac-integration-2.0.5.tar.xz"
             version="2.0.5"
-            hash="sha256:6c4ff7501d7ff35e49068052d80fcf76ce494e5953c5f3967e4958b1b0c67b9f"/>
+            hash="sha256:6c4ff7501d7ff35e49068052d80fcf76ce494e5953c5f3967e4958b1b0c67b9f">
+      <patch 
file="http://git.gnome.org/browse/gtk-osx/plain/patches/0001-Fix-unhandled-exception-from-attempting-to-access-me.patch";
 strip="1"/>
+    </branch>
     <dependencies>
     </dependencies>
     <after>
diff --git a/patches/0001-Fix-unhandled-exception-from-attempting-to-access-me.patch 
b/patches/0001-Fix-unhandled-exception-from-attempting-to-access-me.patch
new file mode 100644
index 0000000..87151bb
--- /dev/null
+++ b/patches/0001-Fix-unhandled-exception-from-attempting-to-access-me.patch
@@ -0,0 +1,39 @@
+From cd3a21ff115cd6c6c11ce39aa62eaf912c78b060 Mon Sep 17 00:00:00 2001
+From: John Ralls <jralls ceridwen us>
+Date: Mon, 30 Dec 2013 12:20:26 -0800
+Subject: [PATCH] Fix unhandled exception from attempting to access menu
+ itemAtIndex:-1
+
+---
+ src/cocoa_menu_item.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/src/cocoa_menu_item.c b/src/cocoa_menu_item.c
+index 793c254..dd46586 100644
+--- a/src/cocoa_menu_item.c
++++ b/src/cocoa_menu_item.c
+@@ -550,12 +550,16 @@ cocoa_menu_item_add_item (NSMenu* cocoa_menu, GtkWidget* menu_item, int index)
+       /* Clean up adjacent separators: */
+       if ([cocoa_menu numberOfItems] > 0)
+       {
+-        if (([cocoa_menu numberOfItems] == index ||
+-             [[cocoa_menu itemAtIndex: index] isSeparatorItem]) &&
+-            [[cocoa_menu itemAtIndex: index - 1] isSeparatorItem])
++        if (index == 0)
++          {
++            if ([[cocoa_menu itemAtIndex: index] isSeparatorItem])
++              [cocoa_menu removeItemAtIndex: index];
++          }
++        else if (([cocoa_menu numberOfItems] == index ||
++                  [[cocoa_menu itemAtIndex: index] isSeparatorItem]) &&
++                 [[cocoa_menu itemAtIndex: index - 1] isSeparatorItem])
+           [cocoa_menu removeItemAtIndex: index - 1];
+-        if (index == 0 && [[cocoa_menu itemAtIndex: index] isSeparatorItem])
+-          [cocoa_menu removeItemAtIndex: index];
++
+       }
+     }
+ 
+-- 
+1.8.3.rc0
+


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