MacOS 10.8 and 11.x.
I see a regression in CudaText,-- app don't get TForm.OnDropFiles when I run the editor from Finder (dbl click on text file or do 'open with'). App runs but don't get OnDropFiles.
I added the Application.MessageBox here:
lazarus/lcl/interfaces/cocoa/cocoaobject.inc
procedure TAppDelegate.application_openFiles(sender: NSApplication; filenames: NSArray);
var
lFiles: array of string;
lNSStr: NSString;
i: Integer;
begin
SetLength(lFiles, filenames.count);
for i := 0 to filenames.count-1 do
begin
lNSStr := NSString(filenames.objectAtIndex(i));
lFiles[i] := NSStringToString(lNSStr);
end;
Application.MessageBox('App openFiles, cnt: '+IntTOstr(filenames.count), 'Cocoa'); //debug
Application.IntfDropFiles(lFiles);
if Application.MainForm<>nil then
Application.MainForm.IntfDropFiles(lFiles);
end;
and msgbox is not called! Maybe a regression in FPC?
This procedure is in the cocoa/cocoaint.pas:
TAppDelegate = objcclass(NSObject, NSApplicationDelegateProtocol)
public
orderArray : PWinLevelOrderArray;
orderArrayCount : Integer;
procedure application_openFiles(sender: NSApplication; filenames: NSArray);
I do cross compile from Linux x64 to Mac.
user@PC:~/fpcupdeluxe/fpcupdeluxe32/fpc/bin/x86_64-linux$ ./fpc
Free Pascal Compiler version 3.2.3-660-g9b2ba834a6 [2022/08/18] for x86_64
It is 'fixes' branch.