Bug 1378 - Lion: StatusItem menu items are disabled
Summary: Lion: StatusItem menu items are disabled
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: MonoMac
Classification: Desktop
Component: Bindings ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-10-09 11:18 UTC by Hylke Bons
Modified: 2015-02-17 13:41 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test case project files (22.40 KB, application/zip)
2011-10-09 11:18 UTC, Hylke Bons
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Hylke Bons 2011-10-09 11:18:21 UTC
Created attachment 649 [details]
Test case project files

I've hit this weird bug with MonoMac on Lion:

When creating an NSStatusItem and opening its menu, all the menu items are disabled, even when they have actions attached to them.

This only happens when launching an app bundle standalone. This doesn't happen when running the app from within MonoDevelop, all menu items are clickable when running it this way.

I've reproduced this in the attached test case.

To reproduce:

Open the project in MD.
Run the project: menu works as expected.

Create a .app using Project -> Create Mac Installer.
Open the bundle by double clicking it: menu doesn't work.


MonoMac version: 2.6.0.62
MonoDevelop version: 2.6.0.1
Comment 1 Hylke Bons 2011-10-09 12:08:29 UTC
Mono 2.10.5
Comment 2 Miguel de Icaza [MSFT] 2011-10-14 20:38:04 UTC
I have CCed Michael Hutchinson to this mail, because I believe he ran into a similar issue in the past.

The problem might be with the differences in Info.plist, but I can not be absolutely sure about it.   

I doubt that this is a bug in the MonoMac bindings themselves, they are likely a problem with the packaging, but I do not know what is wrong, nor where to start with this.
Comment 3 Hylke Bons 2011-10-15 13:18:31 UTC
For what it's worth, here's the diff between the project plist and the bundle plist:

--- Info.project.plist	2011-10-15 18:12:38.000000000 +0100
+++ Info.bundle.plist	2011-10-15 18:13:33.000000000 +0100
@@ -26,5 +26,7 @@
     <string>APPL</string>
     <key>CFBundleSignature</key>
     <string>????</string>
+    <key>MonoBundleExecutable</key>
+    <string>statusitemtest.exe</string>
   </dict>
 </plist>
\ No newline at end of file

I've tried replacing the bundle plist with the project plist and then running the bundle, but it will crash on start without any messages.
Comment 5 Mikayla Hutchinson [MSFT] 2011-10-18 04:46:15 UTC
No idea. Have you tried running the bin/Debug MD-built app bundle from outside MD, i.e. without running mmp?
Comment 6 Hylke Bons 2011-10-18 05:21:09 UTC
open ~/Projects/statusitemtest/statusitemtest/bin/Debug/statusitemtest.app/

This works fine.
Comment 7 Mikayla Hutchinson [MSFT] 2011-10-18 05:49:55 UTC
Weird, so it has something to do with mmp and the absence of a launch script?
Comment 8 Hylke Bons 2011-10-18 07:18:43 UTC
It seems so...

Here's a diff of both .apps:

Hylke-Bonss-MacBook:menutest hbons$ diff -qr statusitemtest.bundle.app/ statusitemtest.project.app/
Only in statusitemtest.project.app/Contents/MacOS: mono-version-check
Files statusitemtest.bundle.app/Contents/MacOS/statusitemtest and statusitemtest.project.app/Contents/MacOS/statusitemtest differ
Only in statusitemtest.bundle.app/Contents: MonoBundle
Only in statusitemtest.project.app/Contents/Resources: MonoMac.dll
Only in statusitemtest.project.app/Contents/Resources: MonoMac.dll.mdb
Only in statusitemtest.project.app/Contents/Resources: statusitemtest.exe
Only in statusitemtest.project.app/Contents/Resources: statusitemtest.exe.mdb
Only in statusitemtest.project.app/: statusitemtest

If there's any more info you need, just say so.
Comment 9 Dave Abrahams 2011-10-24 15:41:10 UTC
FWIW, the SparkleShare project is blocked on this bug.
Comment 10 Mikayla Hutchinson [MSFT] 2011-11-04 19:23:21 UTC
I cannot reproduce the problem with the attached project. It works fine, both when run from MD and when packaged.
Comment 11 Hylke Bons 2011-11-04 19:48:02 UTC
Strange...

What versions of the packages do you have?
I've had several people reproduce this problem.
Comment 12 Mikayla Hutchinson [MSFT] 2011-11-04 19:56:06 UTC
MonoDevelop 2.8.2.
Comment 13 Chris Hamons 2015-02-17 13:41:10 UTC
Hylke Bons,

Apologies in the delay in wrapping up this bug. 

I'm unable to open the project attached in a modern version of Xamarin Studio / Xamarin.Mac. Please open a new bug if this is still an issue and attach a working repro case.