Lazarus without Menu... lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- Frank · 2020-07-17 19:09 Hi All,   I have an interesting situation that, I think, all started with an install of 2.0.10.   I'm running macOS 10.15.5   Up til now (for last 2 years) I've been running svn Lazarus in terminal  with:     /Users/frank/Lazarus/svnlazarus-Cocoa/startlazarus --pcp=/Users/frank/.lazarusSvn-Cocoa   But since FPC3.2.0 (I think), running Lazarus from terminal (or Finder clicking startLazarus.app) will run, but the main menu doesn't show & Lazarus is not in "Force Quit".   The svn version will run with menu IF I :     1/ use .lazarus config and     2/ run lazarus.app     Any ideas what I'm doing wrong ? ---------------------------------------------------------------------- skalogryz · 2020-07-17 20:15 it might be that starting code is making a mistake. Launching lazarus as a unix utility, instead of an application bundle. ---------------------------------------------------------------------- trev · 2020-07-18 03:07 My Lazarus 2.0.6 + FPC 3.0.4 installation works when running the startlazarus executable or startlazarus.app. When I moved to running the trunk version of Lazarus, running the startlazarus executable or the startlazarus.app results in a menu-bar- less Lazarus which does not show up in the Force-Quit menu, but is running: Code: [Select]ps -ax | grep laz  5621 ??         0:01.98 /Users/trev/lazarus-src/lazarus --no-splash- screen --pcp=~/.laz_trunk --force-new-instance Running the lazarus.app works in all cases, so that's what I do. ---------------------------------------------------------------------- skalogryz · 2020-07-18 05:12 i believe the proper command line should look like this: Quote/Users/trev/lazarus-src/lazarus.app/Contents/MacOS/lazarusi wonder if something changed in startlazarus ---------------------------------------------------------------------- trev · 2020-07-18 06:54 Given Dmitry's hint, I deleted the link in startlazarus.app to the startlazarus executable and instead copied it into the bundle along with the lazarus executable and the menu-bar now appears when running the startlazatus.app. [I do wish sometimes that Lazarus would copy/create the executable into/in the bundle and not use a link.] ---------------------------------------------------------------------- Frank · 2020-07-18 08:41 Thank you for your replies. @Dmitry, @trev, Your suggestions got it up and running, thanks. ... Removed last thought ---------------------------------------------------------------------- skalogryz · 2020-07-18 18:17 a couple of things... 1) the issue was due to wrongful (unreliable?) check of the bundle existence. The code was like this: Code: [Select]if FileExists('lazarus.app') then RunBundle() This was changed in r63595 to: Code: [Select]if DirectoryExists('lazarus.app') then RunBundle()so you should not have any problems using startlazarus going forward. If it's ran from bundle (startlazarus.app) or via command line (./startlazarus), it should properly detect the Lazarus bundle and launch it accordingly. Meaning - you will always have menu and the property mouse reaction. 2) Was the original FileExist use wrong? It was not. According to the FileExists documentation: QuoteFileExists returns True if a file with name FileName exists on the disk, False otherwise. On windows, this function will return False if a directory is passed as FileName. On Unixes, passing a directory name will result in True. The rationale is that on UNIX, a directory is a file as well. I think I remember seeing some bug reports due to FileExists returning true for directories. And it might have been changed for FPC 3.2.0 to return false (breaking the bundle detection code). However, that means that the current documentation is wrong. If anyone has fpc 3.0.4. available, you could run the following test on your macOS: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program Project1;{$mode objfpc}{$H+}uses  Classes, SysUtils, BaseUnix; begin  writeln(FileExists('/Applications'));  writeln(FpAccess('/Applications', F_OK));  writeln(DirectoryExists('/Applications'));end.     and see the output. "/Applications" is a directory that exists on any macOS installation. for 3.2.0, the expected output is: Code: [Select]FALSE 0 TRUEfor 3.0.4 the expected output is: Code: [Select]TRUE 0 <-- ??? TRUE I'm wondering if there were some changes in how macOS access() function behaves. ---------------------------------------------------------------------- trev · 2020-07-19 00:05 FPC 3.0.4 Code: [Select]TRUE 0 TRUE FPC 3.2.0 and trunk r45778 Code: [Select]FALSE 0 TRUE ---------------------------------------------------------------------- skalogryz · 2020-07-19 16:57 the same problem caused "run without debugger" not to work ---------------------------------------------------------------------- trev · 2020-07-20 00:45 Now fixed in Lazarus  trunk r63598. Thanks Dmitry!