diff options
Diffstat (limited to 'build-aux/osx/build/modulesets/patches/gtk-mac-integration')
-rw-r--r-- | build-aux/osx/build/modulesets/patches/gtk-mac-integration/0001-Fix-unhandled-exception-from-attempting-to-access-me.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/build-aux/osx/build/modulesets/patches/gtk-mac-integration/0001-Fix-unhandled-exception-from-attempting-to-access-me.patch b/build-aux/osx/build/modulesets/patches/gtk-mac-integration/0001-Fix-unhandled-exception-from-attempting-to-access-me.patch new file mode 100644 index 0000000..87151bb --- /dev/null +++ b/build-aux/osx/build/modulesets/patches/gtk-mac-integration/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 + |