commit b69e6fc3abc499b6585bdd6e7677e78f37115f37
parent 9e3aa336edc8c91406c40ab1977db6683b6cf2fa
Author: Simon Kornblith <simon@simonster.com>
Date: Thu, 9 Jul 2015 16:50:38 -0400
Fix Zotero menu on OS X, part 1
Create a hidden window with a menu bar, since it loads first
Diffstat:
2 files changed, 56 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero-platform/mac/standalone/menuOverlay.xul b/chrome/content/zotero-platform/mac/standalone/menuOverlay.xul
@@ -84,7 +84,7 @@
<menuitem id="menu_preferences"
label="&preferencesCmdMac.label;"
key="key_preferencesCmdMac"
- oncommand="ZoteroPane.openPreferences();"/>
+ oncommand="Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('navigator:browser').ZoteroPane.openPreferences();"/>
<menuitem id="menu_mac_services"
label="&servicesMenuMac.label;"/>
<menuitem id="menu_mac_hide_app"
diff --git a/chrome/content/zotero/standalone/hiddenWindow.xul b/chrome/content/zotero/standalone/hiddenWindow.xul
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<!--
+ ***** BEGIN LICENSE BLOCK *****
+
+ Copyright © 2009 Center for History and New Media
+ George Mason University, Fairfax, Virginia, USA
+ http://zotero.org
+
+ This file is part of Zotero.
+
+ Zotero is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Zotero is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Zotero. If not, see <http://www.gnu.org/licenses/>.
+
+ ***** END LICENSE BLOCK *****
+-->
+
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xul-overlay href="chrome://zotero-platform/content/standalone/menuOverlay.xul"?>
+
+<!DOCTYPE window [
+ <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd"> %globalDTD;
+ <!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd" > %textcontextDTD;
+ <!ENTITY % standaloneDTD SYSTEM "chrome://zotero/locale/standalone.dtd" > %standaloneDTD;
+ <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" > %brandDTD;
+ <!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd"> %zoteroDTD;
+]>
+
+<window id="main-window" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <commandset id="mainCommandSet">
+ <!--FILE-->
+ <command id="cmd_quitApplication" oncommand="goQuitApplication();"/>
+ <command id="cmd_close" oncommand="window.close();"/>
+ </commandset>
+
+ <keyset id="mainKeyset">
+ <key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel"/>
+ </keyset>
+
+ <menubar id="main-menubar">
+ <menu id="fileMenu" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;">
+ <menupopup id="menu_FilePopup"/>
+ </menu>
+ </menubar>
+</window>