Last modified 11 years ago Last modified on 11/06/09 22:56:37

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=PLATFORM_DEPLOY_MAC_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block


(Give as much as possible of the needed information for designing and implementing the task in the following sections.)


There are some platform specific problems related to Mac OS X, that we must take care of.

Task requirements

  • The keyboard shortcuts that are used on Windows and Linux vary on Mac OS X
    • Instead of Ctrl we must use for modifier key Command
    • The Mac option key is acting like an alt key, so it opens the menus - this should be disabled, because the option key is needed to type special characters.
  • Optional - Another issue when starting Sophie seems to start two separate applications, one which runs in the background; when you add a browser frame, another application starts running for webkit, only one app should seem to be running (no matter how many processes it uses).
  • On Mac OS X, we must use mac styled menus (at the top of the screen, not at the top of the app window).
  • Optional - Cursors for changing Sophie layout must change appropriately. Now there is no visual indication for resizing palettes. (Optional may be fixed separately as a bug)

Task result

The result of this task must be source code and instructions for making Mac packages.

Implementation idea

  • Make the IUManager use Mac's AquaLookAndFeel for he menu bar and use "-Dapple.laf.useScreenMenuBar=true" jvm option
  • Don't add mnemonics to menus if we're on mac
  • Use Meta key instead of Control key as modifier on mac
  • Try some option in info.plist file and try to use similar settings when spawning our processes
  • Stop BrowserNativeBridges on application exit

How to demo

  • Run Sophie2 on Mac OS
  • Show the placement of the menus
  • Use some keyboard shortcuts including Command and Option keys
  • Test also on Windows and Linux to see the interface is ok there.


  • In order to ease OS checking add a class OSUtil in org.sophie2.bse.commons.util that has methods for checking if the current os is of some type.
  • In order to use Mac style menus in the SkinManager#lookAndFeel property do the following
    • If we have a LaF defined in the skin after setting it if running on Mac set the "MenuBarUI" property of the UIManager to be ""
    • If we have no LaF defined use the system one instead of the cross-platform one.
    • Besides that add the following VM argument to launch configurations and sophie cripts for Mac OS ; "-Dapple.laf.useScreenMenuBar=true"
  • In order to use the Mac option(alt) key in its natural Mac OS behavior in the methods setting mnemonics in Menu and MenuItem class add a check if we're not running on Mac OS.
  • In order to use Mac command key instead of control as a shortcut
    • If the above is desired we should use "Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();" method
    • Otherwise we use fixed masks.
    • In the OSUtil class add a method that is a shorthand for the mentioned Toolkit method.
    • These are used for menus
    • In InputEventR3 dependent cases use if/else constructs to define the proper key (especially in interaction maps)
    • In TextFlowLogic#ON_INSERT besides the M_CONTROL check add a M_META check
    • Change text editing shortcuts to match MacOS defaults (use TextEdit to compare)
  • Optional requirements cannot be fulfilled now as they seem harder and more native-dependent in their solution. I suggest making a second revision of this task that should handle them alone.
    • The research made about the browser problem suggest using either some environment options (LSUIPresentationMode) or maybe some mac specific classes that control that behavior.


Merged to the trunk at [7974]


(Place the testing results here.)


(Write comments for this or later revisions here.)