Inkscape and Mac OSX menu integration
I think there might be a somewhat involved solution to the problem of integrating mac osx menus in inkscape. Sure having Inkscape with mac-ish menus would be nice.
It entails creating an invisible window with a menu that is managed by OSX-integration. When a menu event is generated, the invisible window delegates the event to the windows that has focus - either via programmatically triggering the window's own - invisible- menu or by directly calling the verb/action.
Valerio
Your email, unfortunately, made me think that OSX menu integration might not be possible, without a major rewriting of the source code. Inkscape's architecture (as for the majority of gtk apps) assumes that, in multi-document mode, every window has its own private menu that receives and process events.
In OSX, in multi-dicument mode, there is only one menu that processes events and dispatches actions to the window that currently has the focus.
It might not be possible to achieve this type of integration with the current state of Inkscape' sources.
On 08/01/2013 18:57, Valerio Aimale wrote:
On 07/01/2013 22:55, Valerio Aimale wrote:
On 07/01/2013 15:45, ~suv wrote:
- Issues noticed with 'Inkscape-r9943-10.7+-x86_64' (on OS X 10.7):
- Menubar (blocker):
Closing a second window opened from within Inkscape may empty the global menubar. The content of the menubar is restored e.g. when opening a new window again (with the keyboard shortcut, or button on the commands bar), or when switching between other document windows if there are still multiple ones open.
Steps to reproduce:
- launch Inkscape.app (with default preferences)
- open new (second) window with 'Ctrl+N'
- close second window with 'Ctrl+W'
--> the menubar now has only one menu ('Inkscape'), which basically allows to quit the application, but nothing else.
- Menubar:
Menu items with a 'checkmark' (toggle state) don't update if the setting is changed (e.g. 'View > Display mode > { … | Normal | No Filters | Outline }' or don't reflect the initial state (e.g. items in 'View > Show/Hide').
<snip>
At first sight the package otherwise seems to be at about the state of gellule's blueprint/branch (which was based on Inkscape trunk from Aug 2012), with similar (known) issues (see below).
<snip>
- Known issues with 'gtk-mac-integration' (from gtk-osx)
(originally tracked in bug #721448 and bug #738973):
Menubar: thousands of console messages about "object class `GtkLabel' has no property named `accel-closure'" (bug #1043266)
Menubar: menus display no keyboard shortcuts (bug #1043266 (gtk-osx), bug #998276 (Unity))
Menubar: 'File > Open Recent' always opens file listed at the top (bug #1043266 (gtk-osx), bug #708185 (Unity), bug #752674 (Unity))
Bundle: Missing Dock & Finder integration (bug #1045963)
<snip>
- Known issues with GTK+/Quartz:
- Quartz backend: Modifiers (Ctrl <-> Alt/Cmd) not swapped (bug #1043266, #438603)
<snip>
Your email, unfortunately, made me think that OSX menu integration might not be possible, without a major rewriting of the source code. Inkscape's architecture (as for the majority of gtk apps) assumes that, in multi-document mode, every window has its own private menu that receives and process events.
In OSX, in multi-dicument mode, there is only one menu that processes events and dispatches actions to the window that currently has the focus.
It might not be possible to achieve this type of integration with the current state of Inkscape' sources.
I think there might be a somewhat involved solution to the problem of integrating mac osx menus in inkscape. Sure having Inkscape with mac-ish menus would be nice.
It entails creating an invisible window with a menu that is managed by OSX-integration. When a menu event is generated, the invisible window delegates the event to the windows that has focus - either via programmatically triggering the window's own - invisible- menu or by directly calling the verb/action.
Commenting here even though the topic is quickly getting way above my head: Personally, I wonder whether it's really about adding some hack, or more about efforts at refactoring some of Inkscape's code base? As I had tried to convey with information provided in earlier replies, some of the issues with the menubar integration also seem to similarly affect Inkscape e.g. on Ubuntu under Unity with the global menu (no icons and keyboard shortcuts for menu items, the 'File > Open Recent' sub-menu is broken in the same way, the toggle state can get out of sync, e.g when working with multiple windows, etc).
Possibly a somewhat related discussion, started during an earlier effort to advance the OS X menu integration of Inkscape: http://inkscape.13.n6.nabble.com/Verbs-SPAction-versus-GtkAction-tt2806978.html
Maybe this should or could be addressed indeed by a refactoring of Inkscape's code base, possibly with increased focus on what GTK3 might offer right now or plans to support? AFAIU at least for the Quartz backend GTK3 already includes menubar integration code which does not require to depend / link against the external gtk-mac-integration library anymore (there's a small demo app installed alongside gtk3-demo, which uses the native global menubar on OS X [1]).
Similarly, the problem with the modifiers in my understanding is likely to require quite a bit of refactoring - GIMP 2.8 is my reference in this regard: AFAICT the GIMP team rewrote large parts of the modifier code last year [2] (IIRC after some refactoring had occurred in upstream GTK2 2.24 first), and now the application out-of-the-box seems to handle modifier keys depending on the backend used for GTK2: on OS X 10.7, my local X11-based build of GIMP 2.8.2 has the (usual) 'Ctrl' modifier in shortcuts, whereas the Quartz-based build of the same GIMP version uses 'Cmd' instead. This is what I'd also like to expect from Inkscape.
[1] demo app: gtk3-demo-application http://git.gnome.org/browse/gtk+/tree/demos/gtk-demo/Makefile.am?h=gtk-3-6#n76 Screenshot: http://dl.dropbox.com/u/65084033/devel/quartz/Screenshot-GTK%2B-3-6-global-menu-1.png
[2] I don't have insight into GIMP's code base, but added links to what I thought might be some of the relevant commits in the last comment of Inkscape's bug report tracking the issue with the "wrong" modifier keys on OS X: https://bugs.launchpad.net/inkscape/+bug/438603
participants (2)
-
Valerio Aimale
-
~suv