After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 624642 - 'GtkAccelLabel' has no member named 'accel_closure'
'GtkAccelLabel' has no member named 'accel_closure'
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
2.7.1
Other Mac OS
: Normal blocker
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2010-07-18 01:46 UTC by Jeff Singleton
Modified: 2012-05-11 21:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ige-mac-menu.c from ige-mac-integration-v0.9.4 (60.84 KB, text/plain)
2010-07-21 19:51 UTC, Jeff Singleton
  Details
ige-mac-menu.h from ige-mac-integration-v0.9.4 (2.66 KB, text/plain)
2010-07-21 19:52 UTC, Jeff Singleton
  Details
Edge mac integration fix (2.81 KB, patch)
2011-01-12 11:06 UTC, Alex Mankuta
none Details | Review
Working accel keys (2.97 KB, patch)
2011-01-12 17:47 UTC, Alex Mankuta
committed Details | Review
app-gui-gui patch (2.49 KB, patch)
2011-01-17 19:07 UTC, Jeff Singleton
none Details | Review
app-gui-Makefile.am patch (306 bytes, patch)
2011-01-17 19:07 UTC, Jeff Singleton
none Details | Review
app-gui-Makefile.in patch (1.35 KB, patch)
2011-01-17 19:08 UTC, Jeff Singleton
none Details | Review
app-gui-main patch (1.36 KB, patch)
2011-01-17 19:08 UTC, Jeff Singleton
none Details | Review
Screenshot GIMP 2.7.2 Quartz-backend Mac OS X (96.83 KB, image/png)
2011-03-10 17:57 UTC, Jeff Singleton
  Details

Description Jeff Singleton 2010-07-18 01:46:28 UTC
Trying to build Gimp 2.7.1 Native on Mac OS X (no X11, with Quartz).  Compile fails each time with the below error(s).  I've tried hacking it to make it work, but I can't seem to get past this.  I've tried comparing the .c and .h from previous versions of GIMP and do not see where the error is originating.  Best guess is header files are not being imported correctly or in the right order, but I just do not have the coding skills needed to fix this....maybe its not even a bug (I could only hope).  Anyway, I appreciate someone looking at this and seeing if they could help me out.

ige-mac-menu.c: In function 'carbon_menu_item_update_state':
ige-mac-menu.c:223: warning: implicit declaration of function 'ChangeMenuItemAttributes'
ige-mac-menu.c: In function 'carbon_menu_item_update_active':
ige-mac-menu.c:237: warning: implicit declaration of function 'CheckMenuItem'
ige-mac-menu.c: In function 'carbon_menu_item_update_submenu':
ige-mac-menu.c:259: warning: implicit declaration of function 'CreateNewMenu'
ige-mac-menu.c:260: warning: implicit declaration of function 'SetMenuTitleWithCFString'
ige-mac-menu.c:261: warning: implicit declaration of function 'SetMenuItemHierarchicalMenu'
ige-mac-menu.c: In function 'carbon_menu_item_update_label':
ige-mac-menu.c:289: warning: implicit declaration of function 'SetMenuItemTextWithCFString'
ige-mac-menu.c: In function 'carbon_menu_item_update_accelerator':
ige-mac-menu.c:305: error: 'GtkAccelLabel' has no member named 'accel_closure'
ige-mac-menu.c:309: error: 'GtkAccelLabel' has no member named 'accel_group'
ige-mac-menu.c:311: error: 'GtkAccelLabel' has no member named 'accel_closure'
ige-mac-menu.c:327: warning: implicit declaration of function 'SetMenuItemCommandKey'
ige-mac-menu.c:346: warning: implicit declaration of function 'SetMenuItemModifiers'
ige-mac-menu.c: In function 'carbon_menu_item_accel_changed':
ige-mac-menu.c:376: error: 'GtkAccelLabel' has no member named 'accel_closure'
ige-mac-menu.c: In function 'carbon_menu_item_update_accel_closure':
ige-mac-menu.c:402: error: 'GtkAccelLabel' has no member named 'accel_closure'
ige-mac-menu.c: In function 'menu_event_handler_func':
ige-mac-menu.c:525: warning: implicit declaration of function 'GetMenuItemProperty'
ige-mac-menu.c: In function 'sync_menu_shell':
ige-mac-menu.c:656: warning: implicit declaration of function 'DeleteMenuItem'
ige-mac-menu.c:678: warning: implicit declaration of function 'GTK_WIDGET_IS_SENSITIVE'
ige-mac-menu.c:681: warning: implicit declaration of function 'GTK_WIDGET_VISIBLE'
ige-mac-menu.c:684: warning: implicit declaration of function 'InsertMenuItemTextWithCFString'
ige-mac-menu.c:687: warning: implicit declaration of function 'SetMenuItemProperty'
ige-mac-menu.c: In function 'parent_set_emission_hook':
ige-mac-menu.c:734: error: 'GtkWidget' has no member named 'parent'
ige-mac-menu.c:736: error: 'GtkWidget' has no member named 'parent'
ige-mac-menu.c: In function 'ige_mac_menu_set_menu_bar':
ige-mac-menu.c:801: warning: implicit declaration of function 'SetRootMenu'
ige-mac-menu.c: In function 'ige_mac_menu_set_quit_menu_item':
ige-mac-menu.c:839: warning: implicit declaration of function 'GetIndMenuItemWithCommandID'
ige-mac-menu.c:842: warning: implicit declaration of function 'SetMenuItemCommandID'
make[3]: *** [ige-mac-menu.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Let me know if there is something else I need to provide.
Comment 1 Michael Schumacher 2010-07-19 09:51:29 UTC
What version of GTK+ is this?
Comment 2 Jeff Singleton 2010-07-19 19:21:30 UTC
v2.20.1 installed using Macports on Snow Leopard. 
Gtk was built with no_x11 and Quartz.
Comment 3 Sven Neumann 2010-07-20 19:04:01 UTC
Are you absolutely sure that you aren't compiling against gtk+ 2.90.x headers?
Comment 4 Jeff Singleton 2010-07-20 20:10:08 UTC
I can reproduce this on GTK 2.20 and 2.90.
Comment 5 Sven Neumann 2010-07-20 20:28:02 UTC
Well, it's totally expected that GIMP won't compile against GTK+ 2.90. GTK+ 2.90 is API incompatible and we haven't ported GIMP to it yet. So please make sure that you don't have GTK+ 2.90 installed on your system.
Comment 6 Jeff Singleton 2010-07-20 20:39:17 UTC
I promise that I do not have 2.90 on my system anymore.  I had it under /usr/local by itself, and just used some variables to point it at 2.90 one time. It ended the exact same line for line that it does with 2.20.1 -- which is under /opt/local (MacPorts default) -- again using variables to point to the correct location.  I have tried it several times using both versions, each ending the same.  I only tried 2.90 as a last ditch effort before opening this bug.

GIMP 2.6.10 compiles without issue under MacPorts and manually from source -- using the same configure arguments with each as outlined under MacPorts so the builds are (or should be) identical.
Comment 7 Michael Natterer 2010-07-20 20:40:07 UTC
This will clearly happen on GTK+ 2.20 too because GIMP defines
GSEAL_ENABLE. Try the following:

In all files that break with such errors, add

#undef GSEAL_DISABLE

*before*

#include <gtk/gtk.h>

And attach the resulting patch to this bug report.

Preferrably, replace all instances of direct struct access
with the proper accessor functions and submit that patch
instead :)
Comment 8 Jeff Singleton 2010-07-20 20:43:07 UTC
I will work on this and update the bug accordingly.  Not sure what is in store for me after this crash, hopefully it won't affect to many more files. Thx.
Comment 9 Sven Neumann 2010-07-20 20:55:06 UTC
Mitch, isn't there a maintained version of ige-mac-menu.c that we could pull in?
Comment 10 Michael Natterer 2010-07-20 22:02:28 UTC
Yeah there is, and somebody even ported it from carbon to cocoa, but
ever since my mac feels so slow (in fact every other machine i use got
like 50 times as fast in the meantime), i only use it for watching
DVDs ;)
Comment 11 Jeff Singleton 2010-07-20 22:33:57 UTC
I saw that change from carbon to cocoa, so I put it back the way it was, because I got a lot of new warnings I wasn't ready to battle. I'm building the gimp now, with the #undef added in only the one file right for now.
Comment 12 Jeff Singleton 2010-07-20 23:36:23 UTC
Same error again ... Before even starting to compile I cleaned out my /usr/local and verified env to ensure no stray vars were set.


FYI ... this crash occurred on a fresh build of all necessary dependencies via MacPorts, including Gimp 2.6.10 against the same version of Gtk.

Should I try forcing 32 bit or maybe forcing gcc44 from MacPorts?



 $ grep SEAL app/gui/ige-mac-menu.c 
 #undef GSEAL_DISABLE

 <snip>
  CC     ige-mac-menu.o
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43,
                 from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:20,
                 from /System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20,
                 from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21,
                 from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20,
                 from ige-mac-menu.c:32:
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h:147: error: format string argument not a string type
ige-mac-menu.c: In function 'carbon_menu_item_update_state':
ige-mac-menu.c:223: warning: implicit declaration of function 'ChangeMenuItemAttributes'
ige-mac-menu.c: In function 'carbon_menu_item_update_active':
ige-mac-menu.c:237: warning: implicit declaration of function 'CheckMenuItem'
ige-mac-menu.c: In function 'carbon_menu_item_update_submenu':
ige-mac-menu.c:259: warning: implicit declaration of function 'CreateNewMenu'
ige-mac-menu.c:260: warning: implicit declaration of function 'SetMenuTitleWithCFString'
ige-mac-menu.c:261: warning: implicit declaration of function 'SetMenuItemHierarchicalMenu'
ige-mac-menu.c: In function 'carbon_menu_item_update_label':
ige-mac-menu.c:289: warning: implicit declaration of function 'SetMenuItemTextWithCFString'
ige-mac-menu.c: In function 'carbon_menu_item_update_accelerator':
ige-mac-menu.c:305: error: 'GtkAccelLabel' has no member named 'accel_closure'
ige-mac-menu.c:309: error: 'GtkAccelLabel' has no member named 'accel_group'
ige-mac-menu.c:311: error: 'GtkAccelLabel' has no member named 'accel_closure'
ige-mac-menu.c:327: warning: implicit declaration of function 'SetMenuItemCommandKey'
ige-mac-menu.c:346: warning: implicit declaration of function 'SetMenuItemModifiers'
ige-mac-menu.c: In function 'carbon_menu_item_accel_changed':
ige-mac-menu.c:376: error: 'GtkAccelLabel' has no member named 'accel_closure'
ige-mac-menu.c: In function 'carbon_menu_item_update_accel_closure':
ige-mac-menu.c:402: error: 'GtkAccelLabel' has no member named 'accel_closure'
ige-mac-menu.c: In function 'menu_event_handler_func':
ige-mac-menu.c:525: warning: implicit declaration of function 'GetMenuItemProperty'
ige-mac-menu.c:527:7: warning: multi-character character constant
ige-mac-menu.c:528:7: warning: multi-character character constant
ige-mac-menu.c: In function 'sync_menu_shell':
ige-mac-menu.c:656: warning: implicit declaration of function 'DeleteMenuItem'
ige-mac-menu.c:678: warning: implicit declaration of function 'GTK_WIDGET_IS_SENSITIVE'
ige-mac-menu.c:681: warning: implicit declaration of function 'GTK_WIDGET_VISIBLE'
ige-mac-menu.c:684: warning: implicit declaration of function 'InsertMenuItemTextWithCFString'
ige-mac-menu.c:687: warning: implicit declaration of function 'SetMenuItemProperty'
ige-mac-menu.c:688:11: warning: multi-character character constant
ige-mac-menu.c:689:11: warning: multi-character character constant
ige-mac-menu.c: In function 'parent_set_emission_hook':
ige-mac-menu.c:734: error: 'GtkWidget' has no member named 'parent'
ige-mac-menu.c:736: error: 'GtkWidget' has no member named 'parent'
ige-mac-menu.c: In function 'ige_mac_menu_set_menu_bar':
ige-mac-menu.c:801: warning: implicit declaration of function 'SetRootMenu'
ige-mac-menu.c: In function 'ige_mac_menu_set_quit_menu_item':
ige-mac-menu.c:839: warning: implicit declaration of function 'GetIndMenuItemWithCommandID'
ige-mac-menu.c:842: warning: implicit declaration of function 'SetMenuItemCommandID'
ige-mac-menu.c:844:28: warning: multi-character character constant
ige-mac-menu.c:845:28: warning: multi-character character constant
ige-mac-menu.c:926:11: warning: multi-character character constant
ige-mac-menu.c:927:11: warning: multi-character character constant
make[3]: *** [ige-mac-menu.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Comment 13 Jeff Singleton 2010-07-20 23:59:58 UTC
I went ahead and tried it using gcc44 in MacPorts for the compiler. The error is different or just not as verbose:

### Configure ###

CC=/opt/local/bin/gcc-mp-4.4 CPP=/opt/local/bin/cpp-mp-4.4 ./configure --prefix=/usr/local --without-mac-twain --with-pdbgen --without-hal --without-x --disable-mmx --disable-sse --disable-gtktest --disable-glibtest --disable-gtk-doc --enable-mp

### Error ###

In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43,
                 from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:20,
                 from /System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20,
                 from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21,
                 from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20,
                 from ige-mac-menu.c:33:
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h:147: error: format string argument not a string type
ige-mac-menu.c: In function 'carbon_menu_item_update_state':
ige-mac-menu.c:224: warning: implicit declaration of function 'ChangeMenuItemAttributes'
ige-mac-menu.c: In function 'carbon_menu_item_update_active':
ige-mac-menu.c:238: warning: implicit declaration of function 'CheckMenuItem'
ige-mac-menu.c: In function 'carbon_menu_item_update_submenu':
ige-mac-menu.c:260: warning: implicit declaration of function 'CreateNewMenu'
ige-mac-menu.c:261: warning: implicit declaration of function 'SetMenuTitleWithCFString'
ige-mac-menu.c:262: warning: implicit declaration of function 'SetMenuItemHierarchicalMenu'
ige-mac-menu.c: In function 'carbon_menu_item_update_label':
ige-mac-menu.c:290: warning: implicit declaration of function 'SetMenuItemTextWithCFString'
ige-mac-menu.c: In function 'carbon_menu_item_update_accelerator':
ige-mac-menu.c:328: warning: implicit declaration of function 'SetMenuItemCommandKey'
ige-mac-menu.c:347: warning: implicit declaration of function 'SetMenuItemModifiers'
ige-mac-menu.c: In function 'menu_event_handler_func':
ige-mac-menu.c:526: warning: implicit declaration of function 'GetMenuItemProperty'
ige-mac-menu.c:528:7: warning: multi-character character constant
ige-mac-menu.c:529:7: warning: multi-character character constant
ige-mac-menu.c: In function 'sync_menu_shell':
ige-mac-menu.c:657: warning: implicit declaration of function 'DeleteMenuItem'
ige-mac-menu.c:679: warning: implicit declaration of function 'GTK_WIDGET_IS_SENSITIVE'
ige-mac-menu.c:682: warning: implicit declaration of function 'GTK_WIDGET_VISIBLE'
ige-mac-menu.c:685: warning: implicit declaration of function 'InsertMenuItemTextWithCFString'
ige-mac-menu.c:688: warning: implicit declaration of function 'SetMenuItemProperty'
ige-mac-menu.c:689:11: warning: multi-character character constant
ige-mac-menu.c:690:11: warning: multi-character character constant
ige-mac-menu.c: In function 'ige_mac_menu_set_menu_bar':
ige-mac-menu.c:802: warning: implicit declaration of function 'SetRootMenu'
ige-mac-menu.c: In function 'ige_mac_menu_set_quit_menu_item':
ige-mac-menu.c:840: warning: implicit declaration of function 'GetIndMenuItemWithCommandID'
ige-mac-menu.c:843: warning: implicit declaration of function 'SetMenuItemCommandID'
ige-mac-menu.c:845:28: warning: multi-character character constant
ige-mac-menu.c:846:28: warning: multi-character character constant
ige-mac-menu.c:927:11: warning: multi-character character constant
ige-mac-menu.c:928:11: warning: multi-character character constant
make[3]: *** [ige-mac-menu.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Comment 14 Sven Neumann 2010-07-21 11:49:48 UTC
If I remember correctly, Snow Leopard doesn't have support for Carbon any longer. So there is no way that you can get this piece of code to compile. Someone needs to pull in the updated version of ige-mac-menu.c.
Comment 15 Jeff Singleton 2010-07-21 14:06:20 UTC
You may be correct...but the Carbon framework is still there, so I assumed it may be possible to hack at the code some to make it compile.  I have tried the noob method of simply pulling in via git the latest ige-mac-integration from GTK-OSX.  But what I see is a lot more work than I am skilled enough to do.

I guess its X11 for me until the newer ige code gets ported.

Thanks for looking into this.
Comment 16 Jeff Singleton 2010-07-21 19:51:20 UTC
Created attachment 166325 [details]
ige-mac-menu.c from ige-mac-integration-v0.9.4

Patch using -p0 from ./app/gui of the GIMP source folder.
Comment 17 Jeff Singleton 2010-07-21 19:52:09 UTC
Created attachment 166326 [details]
ige-mac-menu.h from ige-mac-integration-v0.9.4

Patch using -p0 from ./app/gui of the GIMP source folder.
Comment 18 Jeff Singleton 2010-07-21 19:55:55 UTC
I patched (attached above) ige-mac-menu.c and ige-mac-menu.h using ige-mac-integration-0.9.4 from the macports stable tree (port gtk-osx-application).  Seems there is some undeclared items in gui.c now ... I will look into those and see if I can figure it out.

Here is the error I get when building using the patched version of ige-mac-menu:

gmake[3]: Leaving directory `/Volumes/DEV/src/gimp-2.7.1/app/menus'
Making all in gui
gmake[3]: Entering directory `/Volumes/DEV/src/gimp-2.7.1/app/gui'
  CC     color-history.o
/opt/local/bin/dbus-binding-tool --mode=glib-server --prefix=gimp dbus-service.xml > gimpdbusservice-glue.h
  CC     gimpdbusservice.o
  CC     gimpuiconfigurer.o
  CC     gui.o
gui.c: In function 'gui_restore_after_callback':
gui.c:461: error: 'IgeMacMenuGroup' undeclared (first use in this function)
gui.c:461: error: (Each undeclared identifier is reported only once
gui.c:461: error: for each function it appears in.)
gui.c:461: error: 'group' undeclared (first use in this function)
gui.c:462: warning: ISO C90 forbids mixed declarations and code
gui.c:471: warning: implicit declaration of function 'ige_mac_menu_set_menu_bar'
gui.c:476: warning: implicit declaration of function 'ige_mac_menu_set_quit_menu_item'
gui.c:479: warning: implicit declaration of function 'ige_mac_menu_add_app_menu_group'
gui.c:484: warning: implicit declaration of function 'ige_mac_menu_add_app_menu_item'
gmake[3]: *** [gui.o] Error 1
gmake[3]: Leaving directory `/Volumes/DEV/src/gimp-2.7.1/app/gui'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/Volumes/DEV/src/gimp-2.7.1/app'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/Volumes/DEV/src/gimp-2.7.1'
gmake: *** [all] Error 2
Comment 19 Jeff Singleton 2010-07-23 18:34:47 UTC
Carbon is limited to 32-bit only, that is the fail.  In steps Cocoa used by GTK-OSX (ige-mac-integration) in 64-bit.  Some how, I still don't know how, I managed to port/integrate the necessary piece into the GIMP 2.7.1 tree I am working on. After a few debugs, I managed to get the GIMP to build and launch, however, the "integration" part didn't really work...I got application but no menu items other than the gimp-2.7 menu_item containing Hide and Quit.

I had to change/add definitions, headers, and pull some code from test-integration.c (provided by ige-mac-integration v0.9.4) into app/gui/gui.c, which I'm sure I did all wrong.

Files copied from ige-mac-integration:

src/ige-mac-bundle.c
src/ige-mac-dock.h
src/ige-mac-integration.h
src/ige-mac-private.h
src/ige-mac-bundle.h
src/ige-mac-image-utils.c
src/ige-mac-menu.c
src/ige-mac-dock.c
src/ige-mac-image-utils.h
src/ige-mac-menu.h
src/gtkosxapplication.h
src/gtkosxapplicationprivate.h

Definitions changed/added:

GDK_WINDOWING_QUARTZ changed to IGEMACINTEGRATION (for Carbon builds on 32 bit)

GTKOSXAPPLICATION added (for Cocoa 64-bit)

That is really all I have right now, I am taking another go at the code from scratch to see if I can just pull in and add via #elseif the GTKOSXAPPLICATION menu pieces.

If anyone else is feeling froggy ... I can make a patch from where I am now against the untouched GIMP 2.7.1 source and attach it here.
Comment 20 Jeff Singleton 2010-08-01 16:56:05 UTC
Sorry for the long gap in updates...but...unfortunately, this updating and reintegration of the ige-mac-menu (gtk-osx-application) is out of my league.  I'm a security pro, so don't have time to devote to this big of a project.

I will just have to wait until the real devs get to it.
Comment 21 Hsivank 2010-08-07 20:58:01 UTC
Some patches  [http://trac.macports.org/ticket/25962 here].
Comment 22 Martin Nordholts 2010-09-16 19:09:01 UTC
Review of attachment 166325 [details]:

Setting to needs-work as per comment 18, still doesn't build
Comment 23 Martin Nordholts 2010-09-16 19:09:19 UTC
Review of attachment 166326 [details]:

Setting to needs-work as per comment 18, still doesn't build
Comment 24 Alex Mankuta 2011-01-12 11:06:41 UTC
Created attachment 178119 [details] [review]
Edge mac integration fix

This is my attempt to fix the issue.

Disclaimer
My knowledge of C/C++/GTK+ is next to none. Please be careful applying this patch.

This patch fixed errors for me but there's a bunch of warnings remain. Still I had successful build and GIMP seems to work.

Also note that in carbon_menu_item_update_accelerator I use g_object_get but no g_free or g_object_unref as per documentation. I'm not sure what's the problem but I haven't managed to find the place for unref in that function. It always segfaulted on me. So the function may leak some memory.

Though, there seem to be some problem with the code as most items in menu don't have hotkeys assigned. Only a few system items like Quit GIMP of Hide GIMP have hotkeys assigned.

Another thing is that while focus is in any GIMP window but not in menu hotkeys do not work.

This patch is against git master 229007106e3fbdadbc7bb731124601f65b7e7de7.

I build gimp from git. GTK+ is from git too, gtk-2-24-quartz branch.
Comment 25 Alex Mankuta 2011-01-12 17:47:15 UTC
Created attachment 178163 [details] [review]
Working accel keys

This patch fixes the problem with missing hotkeys in menus
Comment 26 Alex Mankuta 2011-01-12 18:49:40 UTC
There's a problem with hotkeys. Hotkeys in menu state as command key but react to control instead. I'm not sure if that's a GIMP problem.
Comment 27 Jeff Singleton 2011-01-14 16:51:50 UTC
I think the hotkeys are part of the ige-mac-integration dep...found in src/test-integration.c where accel_map would be generated in the source root.  This file can be edited to change any references from <Control> to <Meta>.

I have way to many issues building both GTK+ and GIMP from git.   So I am continuing to hack away at GTK+ 2.23.90 and GIMP 2.7.1 with no luck.  Note I am using the patches from Comment #21 and also the Accel Keys patch from Alex.  All deps necessary for GIMP are built for 64-bit (x86_64-apple-darwin10.5.0) and thus so is my GIMP.

Here is where GIMP compile bombs:

Undefined symbols:
  "_gtk_osxapplication_get_type", referenced from:
      _main in main.o
      _gui_restore_after_callback in libappgui.a(gui.o)
  "_gtk_osxapplication_add_app_menu_group", referenced from:
      _gui_restore_after_callback in libappgui.a(gui.o)
      _gui_restore_after_callback in libappgui.a(gui.o)
  "_gtk_osxapplication_add_app_menu_item", referenced from:
      _gui_restore_after_callback in libappgui.a(gui.o)
      _gui_restore_after_callback in libappgui.a(gui.o)
      _gui_restore_after_callback in libappgui.a(gui.o)
      _gui_restore_after_callback in libappgui.a(gui.o)
  "_gtk_osxapplication_ready", referenced from:
      _main in main.o
  "_gtk_osxapplication_set_menu_bar", referenced from:
      _gui_restore_after_callback in libappgui.a(gui.o)
  "_gtk_osxapplication_set_use_quartz_accelerators", referenced from:
      _gui_restore_after_callback in libappgui.a(gui.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [gimp-2.7] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

-- 
jeff
Comment 28 Hsivank 2011-01-14 19:45:12 UTC
(In reply to comment #27)

Hello Jeff,

add -ligemacintegration to your ldflags

H.sivank
Comment 29 Jeff Singleton 2011-01-17 18:57:06 UTC
Thanks H.  That allowed the build to complete successfully.

However, the GIMP segfaulted with a fatal error. I believe Alex mentions this in Comment #24. So I am going to try building the same git master he did.  If that task ends up requiring a bunch of re-building other stuff, I will go back to 2.7.1 and try building without Alex's patch to see if it still segfaults on launch.

I think that this blocker is real close to being solved.  The segfaulting may be something in my tree, even though I took the time to isolate everything required to build GIMP. I made sure that every dependent was built with the same arch, build, and target...and making sure anything using same configure arguments were set the same. The only thing giving me trouble was ige-mac-integration, that would not successfully 'make install' when using --enable-python=yes during configure.

-- 
J
Comment 30 Jeff Singleton 2011-01-17 18:59:00 UTC
Comment on attachment 166326 [details]
ige-mac-menu.h from ige-mac-integration-v0.9.4

this ended up being useless.
Comment 31 Jeff Singleton 2011-01-17 18:59:24 UTC
Comment on attachment 166325 [details]
ige-mac-menu.c from ige-mac-integration-v0.9.4

this ended up being useless.
Comment 32 Jeff Singleton 2011-01-17 19:07:00 UTC
Created attachment 178549 [details] [review]
app-gui-gui patch

Patch provided by H.sivank to the Macports Trac Bug https://trac.macports.org/ticket/25962
Comment 33 Jeff Singleton 2011-01-17 19:07:44 UTC
Created attachment 178550 [details] [review]
app-gui-Makefile.am patch

Patch provided by H.sivank to the Macports Trac Bug https://trac.macports.org/ticket/25962
Comment 34 Jeff Singleton 2011-01-17 19:08:09 UTC
Created attachment 178551 [details] [review]
app-gui-Makefile.in patch

Patch provided by H.sivank to the Macports Trac Bug https://trac.macports.org/ticket/25962
Comment 35 Jeff Singleton 2011-01-17 19:08:36 UTC
Created attachment 178552 [details] [review]
app-gui-main patch

Patch provided by H.sivank to the Macports Trac Bug https://trac.macports.org/ticket/25962
Comment 36 Maarten Billemont 2011-02-03 18:57:15 UTC
Do these added patches mean that the issues you highlighted in #29 have been resolved now or are there still issues to be worked out before this issue can be closed?
Comment 37 Jeff Singleton 2011-02-03 19:03:53 UTC
I am not the author of these patches, I merely consolidated them into this bug because they are a step in the right direction.  They do help the OS X integration, but there is still the 2 x Apple menu that needs to be fixed.  

The tip from Comment #29 helped the build complete successfully, but the above mentioned issue is still there.

I'm not really sure what the patch "Working accel_keys" does...all it does for 2.7.1 is cause a segfault.

-- 
j
Comment 38 Hsivank 2011-02-03 23:01:21 UTC
Hello Maarten,

My patches 

app-gui-gui patch
app-gui-Makefile.am patch
app-gui-Makefile.in patch
app-gui-main patch 

provide support for Gimp on snow leo (macosx 64 bits) with quartz backend.
ige-mac-integration's source use to be integrated in gimp, but it does not provide 64 bits support.
Instead i use ige-mac-integration from Macports ( it is a recent version 0.9.7 with 64 bits support). 
Macports system detects dependencies and pass correctly ldflag to a port at configure step.
So i have not modify gimp's configure and this is why Jeff ( i think Jeff does not use Macports) has found some problems to link ...

To resume my patch needs :
  - a fix for "the 2 x Apple menu"
  - a fix to pass ige-mac-integration to ldflag

H.sivank
Comment 39 Maarten Billemont 2011-03-06 14:07:43 UTC
I'm not entirely sure whether these issues are related to these patches, but with them applied, I can no longer enter numeric values.  Hitting "1", for instance, triggers the "Display Filters...", regardless of whether I enter the keypad-1 or the 1 above the alpha characters.

I can't test without these patches as gimp won't compile on OS X without them.  I don't have these issues when gimp is compiled for X11 in OS X.
Comment 40 Maarten Billemont 2011-03-06 14:21:30 UTC
OK, After removing key bindings for my numeric keys from the zoom functions, they work again.  I can't imagine how they got there.
Comment 41 Jeff Singleton 2011-03-10 17:55:39 UTC
(In reply to comment #38)
> So i have not modify gimp's configure and this is why Jeff ( i think Jeff does
> not use Macports) has found some problems to link ...

I used to use Macports...but gave up on it, since there are too many old dependencies pulled in for single ports.   I really just need a clean GTK (Quartz) environment without Python24, Python25, GCC, and who knows how many other dependencies that MacPorts insists I need.

I do have an update....I pulled GIMP git master b81276ca83e6ec4c7df32c8f611f441d1dfc59ad last night and only patched using Alex M.`s patch for Working Accel Keys.  GIMP builds, installs, and runs without issue and only has 1x Apple Menu, and does pass the igemacintegration ldflag.

From Terminal...the only errors I am seeing that repeat are:

(gimp-2.7:2218): Gtk-CRITICAL **: gtk_accel_group_from_accel_closure: assertion `closure != NULL' failed
closure: 408110944 (0)
closure: 408072736 (0)
closure: 408030400 (0)
closure: 408088016 (0)
closure: 408131120 (0)
closure: 408034928 (0)
closure: 408052704 (0)
closure: 408038992 (0)

** NOTE **  I did not apply the other patches:

app-gui-gui patch
app-gui-Makefile.am patch
app-gui-Makefile.in patch
app-gui-main patch

GIMP still compiled and launches as expected ... Attaching a screenshot.
Comment 42 Jeff Singleton 2011-03-10 17:57:55 UTC
Created attachment 183080 [details]
Screenshot GIMP 2.7.2 Quartz-backend Mac OS X
Comment 43 Hsivank 2011-03-10 20:49:37 UTC
(In reply to comment #41)
> GIMP still compiled and launches as expected ... 

Looking at http://git.gnome.org/browse/gimp/tree/app/gui/gui.c ,
ige-mac-menu.h is always included without regarding Architecture.

Maybe you have built Gimp and its dependencies without 64 bits support.
Gimp has always built fine on 32 bits Arch ...

H.sivank
Comment 44 Jeff Singleton 2011-03-10 20:58:38 UTC
Nope...GIMP and everything is built with --build=x86_64-apple-darwin10.6.0 

$  lipo -info /usr/local/bin/gimp-2.7 
Non-fat file: /usr/local/bin/gimp-2.7 is architecture: x86_64
Comment 45 Hsivank 2011-03-10 21:44:53 UTC
(In reply to comment #44)

Oh yes i forget that Ige is integrated into Gimp ...
Can you give your Gtk2 revision ?

It is not a good idea to build Ige on 64 bits, it was designed for 32 bits and relies on Carbon api.
This bug was a good opportunity to sync with gtk-osx-application ...

Anyway, this ticket should be closed now ?
Comment 46 Maarten Billemont 2011-03-10 23:09:23 UTC
I don't know whether this is related to these patches, but any key bindings, eg. on 1 to zoom to 1:1 also trigger while you're in a text field or so, basically preventing you from using these keys to enter values.  In X11, gimp ignores these keybinds when the canvas is not focussed.
Comment 47 Jeff Singleton 2011-03-10 23:32:34 UTC
There seems to be a lot of confusion in regards to gtk-osx vs ige-mac...

Macports pulls ige-mac-integration v0.9.6 for gtk-osx-application.  And if ige-mac-integration is for 32bit only then why did it complete successfully.

name            gtk-osx-application
version         0.9.6
categories      devel
homepage        http://live.gnome.org/GTK%2B/OSX/Integration
platforms       darwin
master_sites	http://sourceforge.net/projects/gtk-osx/files/GTK-OSX%20Build/
distname	    ige-mac-integration-${version}  <---- ige?
Comment 48 Jeff Singleton 2011-03-11 00:45:09 UTC
Oh yeah...I'm building against GTK 2.24.1.

And I just tried to build GIMP again, unpatched ... and without -ligemacintegration and it failed:


  CC     ige-mac-menu.o
ige-mac-menu.c: In function ‘carbon_menu_item_update_state’:
ige-mac-menu.c:222: warning: implicit declaration of function ‘ChangeMenuItemAttributes’
ige-mac-menu.c: In function ‘carbon_menu_item_update_active’:
ige-mac-menu.c:236: warning: implicit declaration of function ‘CheckMenuItem’
ige-mac-menu.c: In function ‘carbon_menu_item_update_submenu’:
ige-mac-menu.c:258: warning: implicit declaration of function ‘CreateNewMenu’
ige-mac-menu.c:259: warning: implicit declaration of function ‘SetMenuTitleWithCFString’
ige-mac-menu.c:260: warning: implicit declaration of function ‘SetMenuItemHierarchicalMenu’
ige-mac-menu.c: In function ‘carbon_menu_item_update_label’:
ige-mac-menu.c:288: warning: implicit declaration of function ‘SetMenuItemTextWithCFString’
ige-mac-menu.c: In function ‘carbon_menu_item_update_accelerator’:
ige-mac-menu.c:304: error: ‘GtkAccelLabel’ has no member named ‘accel_closure’
ige-mac-menu.c:308: error: ‘GtkAccelLabel’ has no member named ‘accel_group’
ige-mac-menu.c:310: error: ‘GtkAccelLabel’ has no member named ‘accel_closure’
ige-mac-menu.c:326: warning: implicit declaration of function ‘SetMenuItemCommandKey’
ige-mac-menu.c:345: warning: implicit declaration of function ‘SetMenuItemModifiers’
ige-mac-menu.c: In function ‘carbon_menu_item_accel_changed’:
ige-mac-menu.c:375: error: ‘GtkAccelLabel’ has no member named ‘accel_closure’
ige-mac-menu.c: In function ‘carbon_menu_item_update_accel_closure’:
ige-mac-menu.c:401: error: ‘GtkAccelLabel’ has no member named ‘accel_closure’
ige-mac-menu.c: In function ‘menu_event_handler_func’:
ige-mac-menu.c:524: warning: implicit declaration of function ‘GetMenuItemProperty’
ige-mac-menu.c: In function ‘sync_menu_shell’:
ige-mac-menu.c:655: warning: implicit declaration of function ‘DeleteMenuItem’
ige-mac-menu.c:677: warning: implicit declaration of function ‘GTK_WIDGET_IS_SENSITIVE’
ige-mac-menu.c:680: warning: implicit declaration of function ‘GTK_WIDGET_VISIBLE’
ige-mac-menu.c:683: warning: implicit declaration of function ‘InsertMenuItemTextWithCFString’
ige-mac-menu.c:686: warning: implicit declaration of function ‘SetMenuItemProperty’
ige-mac-menu.c: In function ‘parent_set_emission_hook’:
ige-mac-menu.c:733: error: ‘GtkWidget’ has no member named ‘parent’
ige-mac-menu.c:735: error: ‘GtkWidget’ has no member named ‘parent’
ige-mac-menu.c: In function ‘ige_mac_menu_set_menu_bar’:
ige-mac-menu.c:800: warning: implicit declaration of function ‘SetRootMenu’
ige-mac-menu.c: In function ‘ige_mac_menu_set_quit_menu_item’:
ige-mac-menu.c:838: warning: implicit declaration of function ‘GetIndMenuItemWithCommandID’
ige-mac-menu.c:841: warning: implicit declaration of function ‘SetMenuItemCommandID’
make[4]: *** [ige-mac-menu.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

So that ige-mac-menu patch from Alex M. fixes something....I don't know how to force it to build against GtkOSXApplication, I figured building 64 bit would just figure that out.  Besides they are both the same tarball, ige-mac-integration-0.9.7.tar.bz2.  Hence why I am confused by the Comment #45.

--
J
Comment 49 Hsivank 2011-03-11 21:21:19 UTC
(In reply to comment #48)

gtk-osx-application and ige-mac-integration  point on the same source (ige-mac-integration version is higher cause it has been recently updated). 
There is two api in this source one for 32 bits (ige) and one for 64 bits (gtkosxapplication).
If you build this source with 32 bits arch defined ige will be used. if you build the same source with 64 bits defined gtk-osx-application will be used.

The problem here is that the faulty file (ige-mac-menu.c) comes from 32 bits API and should not be used for 64 bits compilation ...

Patch from Alex fixes build of internal ige-mac-menu.c. In this case it should not be needed to add -ligemacintegration.
Comment 50 Jeff Singleton 2011-03-11 21:52:05 UTC
Which is what I suspected was happening....I'm definitely building 64bit.  I even mentioned the Carbon vs Cocoa issue in Comment #19.

I'm satisfied at this point...I can live with patching ige-mac-menu.c in order to get GIMP to compile.  

I recompiled this morning just to make sure I didn't miss something.  Everything works as expected after the second build with Alex's patch.

To top it off ... I used the gimpguts.sh from (http://gimp-app.sourceforge.net/GIMPskel.zip) to construct an Apple bundle, with one small change to the pangorc file so it pointed to the wrapped-up version of  pango.modules and away we go.

Now ... I need some graphics to edit ;^)
Comment 51 Martin Nordholts 2011-03-14 07:51:18 UTC
The patches below contains too much Mac specific code for my liking, and it's a big annoying to review them when there is one patch per file. Can someone create a "git format-patch" formated patch and attach please?

Anyway, this is not critial to sort out for a 2.8 release, moving to 2.10
Comment 52 Clemens Adolphs 2011-03-16 16:33:42 UTC
Review of attachment 178552 [details] [review]:

Applying this patch to the current git head did not work for me. I checked, and apparently this patch has already found its way into head, in some way or another. At least from my understanding.
Comment 53 Hsivank 2011-03-16 23:30:29 UTC
(In reply to comment #52)
This patch was made against gimp 2.7.1, It seems that it is not integrated into master.
Comment 54 Michael Natterer 2011-09-01 19:37:51 UTC
Comment on attachment 178163 [details] [review]
Working accel keys

Applied this patch to make it work on 32 bit again:


commit 0351c13a36b01e45be65c616a6d52b28445247af
Author: Michael Natterer <mitch@gimp.org>
Date:   Thu Sep 1 21:25:00 2011 +0200

    Bug 624642 - 'GtkAccelLabel' has no member named 'accel_closure'
    
    Apply cleaned up and fixed patch from Alex Mankuta which
    undeprecates ige-mac-menu.c. The file builds now and I only
    see warnings about using unknown Carbon API, but I have no
    way of checking if it still works on systems where the
    deprecated Carbon API actually does something.

 app/gui/ige-mac-menu.c |  114 +++++++++++++++++++++++++++++-------------------
 1 files changed, 69 insertions(+), 45 deletions(-)
Comment 55 Michael Natterer 2012-05-11 21:40:12 UTC
This bug report got too long. It build and works now, so let's close
it, this bug is not primarily about porting to newer mac intrgration
stuff anyway.