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 477381 - Use the Mac OS X menubar when built with GTK+/Quartz
Use the Mac OS X menubar when built with GTK+/Quartz
Status: RESOLVED OBSOLETE
Product: Gnumeric
Classification: Applications
Component: GUI
git master
Other Mac OS
: Normal enhancement
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2007-09-16 03:46 UTC by W. Michael Petullo
Modified: 2018-05-22 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to use Mac OS X menubar (20.51 KB, patch)
2007-09-16 04:37 UTC, W. Michael Petullo
none Details | Review
Patch to use Mac OS X menubar (2.39 KB, patch)
2008-05-23 02:37 UTC, W. Michael Petullo
none Details | Review
Patch to use Mac OS X menubar (20.51 KB, patch)
2008-05-24 15:34 UTC, W. Michael Petullo
none Details | Review
Patch to use Mac OS X menubar (4.36 KB, patch)
2008-05-24 15:36 UTC, W. Michael Petullo
none Details | Review
Patch to use Mac OS X menubar (4.57 KB, patch)
2010-04-10 01:06 UTC, W. Michael Petullo
none Details | Review
use gtk-osx-application api (1.87 KB, patch)
2013-09-08 19:18 UTC, c.herbig
none Details | Review
use gtk-osx-application api (2.03 KB, patch)
2013-09-08 23:14 UTC, c.herbig
none Details | Review
use gtk-osx-application api (2.62 KB, patch)
2013-09-14 05:39 UTC, c.herbig
none Details | Review

Description W. Michael Petullo 2007-09-16 03:46:54 UTC
I have been working on building gnumeric using GTK+/Quartz (no X11) [1].

A developer at Imendio has written a function that allows GTK+/Quartz applications to use the Mac OS X menubar [2].  I have written a patch to gnumeric to take advantage of this function to integrate gnumeric more completely into the Mac OS X environment.

The steps I take to build gnumeric using GTK+/Quartz are documented at [3].

[1] http://developer.imendio.com/projects/gtk-macosx
[2] http://developer.imendio.com/projects/gtk-macosx/menubar
[3] http://flyn.org/apple/
Comment 1 W. Michael Petullo 2007-09-16 04:37:41 UTC
Created attachment 95663 [details] [review]
Patch to use Mac OS X menubar
Comment 2 Morten Welinder 2007-09-16 16:20:15 UTC
Intersting.  Most of it looks like it belongs in gtk+, though.
Comment 3 Jody Goldberg 2007-09-18 03:38:44 UTC
Very interesting.  If you get a native build please tell us how to regenerate.
However, Morten is correct.  The native code belongs in gtk, or at worst libgoffice.  I don't like #ifdefs, but that's small enough that it could go in.

Any screenshots ?
Comment 4 W. Michael Petullo 2007-09-20 23:11:55 UTC
I do have some crude instructions at http://www.flyn.org/apple/index.html.

Also, there is a screenshot of GTK+/Quartz gnumeric at http://www.flyn.org/apple/screenshots/gnumeric.png.
Comment 5 W. Michael Petullo 2008-05-21 04:16:52 UTC
Imendio is working on a new library to replace their sync-menu code. 

See http://developer.imendio.com/projects/gtk-macosx/integration .

I asked the developer a bit about future plans for the code and his response may be found at http://developer.imendio.com/node/216 .
Comment 6 W. Michael Petullo 2008-05-23 02:37:08 UTC
Created attachment 111381 [details] [review]
Patch to use Mac OS X menubar

This is a new patch against 1.9.0 that uses the new Imendio library.
Comment 7 W. Michael Petullo 2008-05-24 15:34:52 UTC
Created attachment 111461 [details] [review]
Patch to use Mac OS X menubar

This moves the "Quit" menu item to the application menu (a Mac OS X convention) and hides the GTK+ menu.
Comment 8 W. Michael Petullo 2008-05-24 15:36:17 UTC
Created attachment 111462 [details] [review]
Patch to use Mac OS X menubar

Replaces previous patch because I uploaded the wrong file.
Comment 9 W. Michael Petullo 2008-06-03 02:06:31 UTC
For reference, Inkscape uses the Imendio Mac OS X menu library, though they include ige-mac-menu.c and ige-mac-menu.h directly in their source tree.
Comment 10 rainwoodman 2009-01-18 16:47:43 UTC
Apparently ige library is not actively maintained for a while.

There is a plan to integrate ige-mac-menu xxx into Global Menu at 

http://code.google.com/p/gnome2-globalmenu/issues/detail?id=136

If anyone wants to make effort on this?

the gtk module won't require anything to be modified with GTK, and it will be transparent:
once the module is loaded, menu go to mac, unloaded, they come back to the application.

Comment 11 W. Michael Petullo 2010-04-10 01:06:59 UTC
Created attachment 158350 [details] [review]
Patch to use Mac OS X menubar

This patch is against gnumeric 1.10.1.

Work on the IGE library has resumed. See http://gtk-osx.sourceforge.net/.
Comment 12 c.herbig 2013-09-08 19:17:16 UTC
Building on the previous work, I was able to make a new patch (using the MacPorts convention) that uses the newer gtk-osx-application.  This is not intended to be patched into the gnumeric code base but rather at the MacPorts level, but I still put it here for study and review.

There are still a couple problems, trying to move Help and Preferences segfaults, and Quit does not want to be hidden (Gtk-CRITICAL **: void gtk_widget_hide(GtkWidget *): assertion `GTK_IS_WIDGET (widget)' failed).  Opening a new workbook causes the terminal to throw a tantrum since the menu object has already been sent to OS X, but still works in the end (this might be a bug in gtk-osx-application).  However, any general advise would be well appreciated.

Comment 2 states that this belongs in Gtk, and it probably does, but the gtk-osx-application documentation states it currently has to be done in the application itself.
Comment 13 c.herbig 2013-09-08 19:18:26 UTC
Created attachment 254433 [details] [review]
use gtk-osx-application api

This is experimental.
Comment 14 c.herbig 2013-09-08 19:27:14 UTC
P.S. Contrary to the gtk-osx-application documentation, the order of gtkosx_application_set_help_menu and gtkosx_application_set_window_menu doesn't seem to make any difference in putting them in the correct order on the menubar (probably another gtk-osx-application bug).
Comment 15 c.herbig 2013-09-08 23:14:39 UTC
Created attachment 254437 [details] [review]
use gtk-osx-application api

Now that I have been able to look over this again, I found that most of the problems in Comment 12 were due to typos in the "/menubar/*" parameters.  It still throws errors when opening a second window, and the windows/help menus are still out of order.  I still don't know how to remove/hide the separators in the original menu structures other than to make a patch that removes them from GNOME_Gnumeric-gtk-xml.in
Comment 16 c.herbig 2013-09-14 05:39:00 UTC
Created attachment 254902 [details] [review]
use gtk-osx-application api

I found that by putting this functionality at the end of the UI setup function, the Toolbars submenu reappears, and things seem to work a bit better.  This also adds the Gnumeric icon to the dock, and tidies up a few other things.  It is probably the last update I will include here.  There seem to be efforts to remake gtkosx-application functionality into part of the official quartz backend in Gtk3.  However, for study and review, here it is.
Comment 17 GNOME Infrastructure Team 2018-05-22 13:23:01 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnumeric/issues/81.