View Issue Details

IDProjectCategoryView StatusLast Update
0014411LazarusIDEpublic2011-12-01 11:22
ReporterPhil Assigned ToFelipe Monteiro de Carvalho  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformMac PowerPCOSOS X 
Product Version0.9.27 (SVN) 
Target Version0.9.28Fixed in Version0.9.27 (SVN) 
Summary0014411: IDE "Lazarus" menu is broken
DescriptionSerious regression from 0.9.26.2:

(1) Huge space between Apple menu and Lazarus menu in IDE (roughly 100 pixels).

(2) Only one item is now on the Lazarus menu: About.

Looks fine on OS X 10.5 / Intel.

Thanks.

-Phil
Steps To ReproduceRun on 10.4 system.

TagsNo tags attached.
Fixed in Revision21578
LazTarget0.9.28
WidgetsetCarbon
Attached Files

Relationships

related to 0012294 assignedDmitry Boyarintsev "About Lazarus" menu item should be in the Application menu under Mac OS X 

Activities

Dmitry Boyarintsev

2009-08-22 21:54

developer   ~0030083

What about the empty space between Apple and Lazarus menus. Does it act like a menu (without a caption), any sub-menu items?

Dmitry Boyarintsev

2009-08-22 22:00

developer   ~0030084

could test the attached project as well. You should get the same result as shown on the screenshot.

2009-08-22 22:00

 

TestMenuProject.zip (3,787 bytes)

2009-08-22 22:00

 

Picture 9.png (45,882 bytes)   
Picture 9.png (45,882 bytes)   

Phil

2009-08-29 18:43

reporter   ~0030226

Yes, clicking on the blank space between the Apple and Lazarus menus shows the Services, Hide Lazarus, Hide Others, Show All and Quit menu items - and they all work fine. Clicking on the Lazarus menu shows only the About menu item - and it works fine too.

The attached project works as expected. All menu items are on the project1 menu, including App SubItem 1 and 2. The File menu has File Sub Item 1, 2 and 3.

Thanks.

-Phil

Dmitry Boyarintsev

2009-08-29 19:56

developer   ~0030227

Last edited: 2009-08-29 21:16

Phil,

could you test another thing for me:
- open lazarus/ide/mainbase.pas
- find a line (0000348 or so), containing:
    CreateMainMenuItem(mnuApple,'AppleApplication','');

- replace the line with the following:
    CreateMainMenuItem(mnuApple,'AppleApplication',#$EF#$A3#$BF);

- rebuild IDE and see if problem disappears.

Phil

2009-08-30 07:02

reporter   ~0030230

Same thing.

It appears as though the Apple char is getting to TCarbonMenu.Attach okay as UTF8, so specifying a UTF8 string doesn't make any difference.

It looks like an extra menu is getting inserted. The menu manager sees the Apple char and substitutes the app bundle's name ("Lazarus") for it, but for some reason it's not adding the standard application menu items to it.

I'm not sure if this is the proper approach anyway. By default a Carbon app has an application menu. All we want to do is add the About item to it. In other code I've seen, it looks like they get the menu for an item they know is on the app menu (for example, Hide), then insert any new items in that menu. Whereas the Laz approach creates a new menu. Maybe 10.5 is smart enough to figure all this out, but 10.4 must not be.

Thanks.

-Phil

Dmitry Boyarintsev

2009-08-30 10:31

developer   ~0030232

OSX 10.4 should be smart enough as well.
Because, the test project works without the bug.

the bug is caused by something else.

Phil

2009-08-30 19:09

reporter   ~0030245

Correct, although the test project loads the entire menu from the form and the Laz IDE appears to create the entire menu system in code. Maybe the sequence of steps is different enough that it's interfering somewhere.

Do you know when the last time the Laz IDE menu was known to work correctly on 10.4? Maybe a change in the IDE menu creation code caused this. Certainly that's one big difference between the test project and Laz since both are using the same LCL and Carbon code.

Let me know if you have other tests that you would like me to run.

Thanks.

-Phil

Phil

2009-08-31 01:33

reporter   ~0030260

See attached project, which adds app menu programmatically rather than via form. Project works fine so that's probably not the issue with IDE.

Lazarus does give some other errors at startup related to menus, but these deal with the Window menu and appear to be unrelated to the app menu problem -- I see the same thing in another app where the app menu works fine. Just for the record the errors are as follows. I believe -50 is invalid param.

TCarbonMenu.SetCaption Error: ChangeMenuItemAttributes failed with result -50
TCarbonMenu.SetCaption Error: SetMenuItemTextWithCFString failed with result -50
TCarbonMenu.Update Error: SetMenuItemHierarchicalMenu failed with result -50
TCarbonMenu.SetBitmap Error: SetMenuItemIconHandle failed with result -50
TCarbonMenu.SetVisible Error: ChangeMenuItemAttributes show failed with result -50

2009-08-31 01:34

 

testmenu2.zip (4,224 bytes)

Dmitry Boyarintsev

2009-08-31 09:30

developer   ~0030261

The error messages has been there time, long time ago.
And you're right saying that they should be fixed.

Dmitry Boyarintsev

2009-08-31 11:18

developer   ~0030263

Phil, I've cleaned Carbon menu creation. It should no longer give "-50" errors.

Although it should not effect the Apple menu usage, but could you test it?

Phil

2009-09-01 22:37

reporter   ~0030300

These changes haven't made it into the 0.9.27 snapshots yet. Will they at some point? Realistically I only time to work with the forthcoming 0.9.28.

Thanks.

-Phil

Dmitry Boyarintsev

2009-09-02 20:55

developer   ~0030337

here's the patch, that restores old behavior

2009-09-02 20:55

 

mainbase.pas.patch (1,672 bytes)   
Index: ide/mainbase.pas
===================================================================
--- ide/mainbase.pas	(revision 21540)
+++ ide/mainbase.pas	(working copy)
@@ -344,7 +344,7 @@
     // a special Apple menu and put Quit, About there.
     // See issue: http://bugs.freepascal.org/view.php?id=12294
     // See http://lists.apple.com/archives/carbon-development/2002/Apr/msg01183.html, for details
-    CreateMainMenuItem(mnuApple,'AppleApplication','');
+    //CreateMainMenuItem(mnuApple,'AppleApplication','');
     {$endif}
     CreateMainMenuItem(mnuFile,'File',lisMenuFile);
     CreateMainMenuItem(mnuEdit,'Edit',lisMenuEdit);
@@ -791,17 +791,22 @@
     CreateMenuItem(ParentMI,itmHelpReportingBug,'itmHelpReportingBug',
                    lisMenuReportingBug, 'menu_reportingbug');
 
-    {$ifdef LCLCarbon}
+    // old behavior restored, until Tiger issue is fixed.
+    // http://bugs.freepascal.org/view.php?id=14411
+    (*
+   {$ifdef LCLCarbon}
     // under Carbon: add About item to the Apple menu
     CreateMenuItem(mnuApple, itmHelpAboutLazarus,'itmHelpAboutLazarus',
                    lisAboutLazarus, 'menu_information');
-    {$else}
+    
+    CreateMenuSeparatorSection(mnuHelp,itmInfoHelps,'itmInfoHelps');
+    {$else}*)
     // otherwise: add About item to the Help menu
     CreateMenuSeparatorSection(mnuHelp,itmInfoHelps,'itmInfoHelps');
     ParentMI:=itmInfoHelps;
     CreateMenuItem(ParentMI,itmHelpAboutLazarus,'itmHelpAboutLazarus',
                  lisAboutLazarus, 'menu_information');
-    {$endif}
+    //{$endif}
 
     CreateMenuSeparatorSection(mnuHelp,itmHelpTools,'itmHelpTools');
     ParentMI:=itmHelpTools;
mainbase.pas.patch (1,672 bytes)   

Phil

2009-09-06 00:25

reporter   ~0030467

I haven't heard an answer to my question: Will some patch be made to 0.9.28 before it's released to correct this menu bar regression from 0.9.26.2?

Also, why not go ahead and add About to the app menu on Intel since we know it works there and only revert back to old menu behaviors on PowerPC?

Issue History

Date Modified Username Field Change
2009-08-22 21:28 Phil New Issue
2009-08-22 21:28 Phil Widgetset => Carbon
2009-08-22 21:43 Vincent Snijders LazTarget => 0.9.28
2009-08-22 21:43 Vincent Snijders Assigned To => Dmitry Boyarintsev
2009-08-22 21:43 Vincent Snijders Status new => assigned
2009-08-22 21:43 Vincent Snijders Target Version => 0.9.28
2009-08-22 21:54 Dmitry Boyarintsev Note Added: 0030083
2009-08-22 22:00 Dmitry Boyarintsev Note Added: 0030084
2009-08-22 22:00 Dmitry Boyarintsev File Added: TestMenuProject.zip
2009-08-22 22:00 Dmitry Boyarintsev File Added: Picture 9.png
2009-08-25 08:47 Vincent Snijders Status assigned => feedback
2009-08-29 18:43 Phil Note Added: 0030226
2009-08-29 19:36 Dmitry Boyarintsev Status feedback => assigned
2009-08-29 19:56 Dmitry Boyarintsev Note Added: 0030227
2009-08-29 19:57 Dmitry Boyarintsev Note Edited: 0030227
2009-08-29 19:58 Dmitry Boyarintsev Status assigned => feedback
2009-08-29 21:16 Dmitry Boyarintsev Note Edited: 0030227
2009-08-30 07:02 Phil Note Added: 0030230
2009-08-30 10:31 Dmitry Boyarintsev Note Added: 0030232
2009-08-30 10:32 Dmitry Boyarintsev Status feedback => assigned
2009-08-30 19:09 Phil Note Added: 0030245
2009-08-31 01:33 Phil Note Added: 0030260
2009-08-31 01:34 Phil File Added: testmenu2.zip
2009-08-31 09:30 Dmitry Boyarintsev Note Added: 0030261
2009-08-31 11:18 Dmitry Boyarintsev Note Added: 0030263
2009-08-31 11:19 Dmitry Boyarintsev Status assigned => feedback
2009-09-01 22:37 Phil Note Added: 0030300
2009-09-02 20:55 Dmitry Boyarintsev Note Added: 0030337
2009-09-02 20:55 Dmitry Boyarintsev File Added: mainbase.pas.patch
2009-09-02 21:40 Dmitry Boyarintsev Status feedback => assigned
2009-09-04 19:20 Felipe Monteiro de Carvalho Assigned To Dmitry Boyarintsev => Felipe Monteiro de Carvalho
2009-09-04 19:26 Felipe Monteiro de Carvalho Fixed in Revision => 21578
2009-09-04 19:26 Felipe Monteiro de Carvalho Status assigned => resolved
2009-09-04 19:26 Felipe Monteiro de Carvalho Fixed in Version => 0.9.29 (SVN)
2009-09-04 19:26 Felipe Monteiro de Carvalho Resolution open => fixed
2009-09-06 00:25 Phil Note Added: 0030467
2009-09-10 08:53 Vincent Snijders Fixed in Version 0.9.29 (SVN) => 0.9.27 (SVN)
2011-10-02 19:32 Felipe Monteiro de Carvalho Relationship added related to 0012294
2011-12-01 11:22 Marc Weustink Status resolved => closed