Why can't I launch Cmd-Tab in the application window on Mac OS X 10.9 after upgrading to XULRunner 33?

I have a standalone XULRunner application that previously used XULRunner 1.9.2 (old, I know). I just upgraded to XULRunner 33.

Previously, when I developed locally (MacBook Pro with Mac OS X 10.9.5), I often had Cmd + Tab between my IDE and my application.

After the upgrade, I can no longer do this. I still get a window on my desktop (as defined in main.xul ), but it no longer appears in my Cmd + Tab list. I have to β€œfind” it on the desktop.

Closing the window terminates the application, etc., and the fact that I get the application window in general implies that my main.xul correct ... but I do not know why this is so.

 <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://my-app-name/skin/css/main.css" type="text/css"?> <!DOCTYPE window SYSTEM "chrome://my-app-name/locale/main.dtd"> <window id="main" title="&window-title;" width="750" height="530" persist="width,height,screenX,screenY,sizemode" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script><!-- MY APPLICATION CODE HERE --></script> <keyset> <key modifiers="accel" key="W" oncommand="window.close()"/> <key modifiers="accel" key="Q" id="quit"/> </keyset> <toolbox> <menubar> <menu id="menu_file" label="File" hidden="true"> <menupopup> <menuitem id="menu_FileQuitItem" key="quit" label="Quit" oncommand="goQuitApplication();"/> </menupopup> </menu> </menubar> </toolbox> </window> 

I read Windows and menus in XULRunner :

The same code on XULRunner 1.9.2 works fine, and I can "activate" the window. With the new XULRunner, the window title is grayed out on Mac OS X and cannot be selected.

Any ideas on what to try?

I don't know if this is useful, but I also used to get the menu bar in OS X when the window was selected. Even now, if I click on the window title bar, my application does not appear in the menu bar displayed by OS X.

+6
source share
1 answer

I don’t know what was changed, or when they changed it, but this behavior is somewhat documented in MDN.

Excerpt from Getting Started with XULRunner :

On a Mac, before you can start the XULRunner application with everything intact, you must install it using the command line flag --install-app xulrunner. Installing the application creates the OS X application package:

The page contains some steps for how to do this, but I could never get them to work with modern versions of XULRunner.

The only way I could ever get modern versions of XULRunner to fully work is to manually create the application package.

In this example, I'm going to use the "hello world" example specified in MDN docs.

Step 1:

Create the following directory structure.

 hello.app/ Contents/ MacOS/ Resources/ 

Step 2:

Download the version of XULRunner that you want (I am using 33) and extract the XUL.framework .

Step 3:

Copy all the files inside XUL.framework/Versions/Current/ to hello.app/Contents/MacOS/ .

Also copy dependentlibs.list to hello.app/Contents/Resources/

Step 4:

Download the sample files and copy the following files and directories to hello.app/Contents/Resources/ .

  • chrome/
  • defaults/
  • application.ini
  • chrome.manifest

Step 5:

Due to another problem , the xulrunner binary will not automatically find application.ini as it intended. To get around this, we need a stub loader, like the one I wrote earlier.

 #!/bin/sh runpath="`dirname "$0"`" contentsdir="`cd "$runpath"/.. > /dev/null && pwd`" exec "$runpath/xulrunner" --app "$contentsdir/Resources/application.ini" 

Create a new file called hello in hello.app/Contents/MacOS/hello , put the code above inside and give it executable permissions ( chmod +x hello ).

Step 6:

Now we need the Info.plist file. Here is one that I created based on the XULRunner deployment example . Please note that CFBundleExecutable must match the bootloader file name above.

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>hello</string> <key>CFBundleGetInfoString</key> <string>1.0</string> <key>CFBundleIconFile</key> <string>app_icon.icns</string> <key>CFBundleIdentifier</key> <string>net.yourcompany.yourapplication</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>applicationName</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1.0</string> </dict> </plist> 

Save this file under hello.app/Info.plist .

Step 7:

Create a new file called PkgInfo in hello.app/PkgInfo and place this text inside.

 APPL???? 

Step 8:

Now you can start your application using the menu icon and doc and Cmd + Tab . You can open it using the Finder or the command line.

 $ ./hello.app/Contents/MacOS/hello 
+2
source

Source: https://habr.com/ru/post/985489/


All Articles