View Issue Details

IDProjectCategoryView StatusLast Update
0034121LazarusLCLpublic2018-08-17 05:53
ReporterDavid Assigned ToDmitry Boyarintsev  
Status closedResolutionfixed 
Product Version1.8.5 (SVN) 
Summary0034121: Cocoa does not report on clipboard contents correctly.
DescriptionThe function ClipboardGetFormats() is intended to describe whats currently in the clipboard. It should return with a list if Format IDs and a Count of their number. Applications (and wrapper functions) depend on this to determine if the clipboard has content suitable to its needs.

However, line 0000254 of
function TCocoaWidgetSet.ClipboardGetFormats(ClipboardType: TClipboardType;
  var Count: integer; var List: PClipboardFormat): boolean;

does not alter Count and appears to put rubbish in the list.
Steps To ReproduceSee attached demo project.

It calls ClipboardGetFormats() and displays what is returned. Returns correct info under Linux and Carbon, not under Cocoa.
TagsNo tags attached.
Fixed in Revision58695
Attached Files



2018-08-12 06:14

reporter (3,170 bytes)

Dmitry Boyarintsev

2018-08-12 16:38

developer   ~0109999

please test and close, if ok


2018-08-13 07:17

reporter   ~0110007

No, sorry, Cocoa is not compiling now. I don't know if this problem is caused by this checkin.

cocoawscomctrls.pas(323,36) Error: method identifier expected

thats this line :
  lResult := TCocoaStatusBar.alloc.lclInitWithCreateParams(AParams);

Here is the files updated from the SVN version that did compile a few days ago -

U ide/frames/editor_markup_options.lfm
U ide/lazarusidestrconsts.pas
U lcl/dbctrls.pp
U lcl/interfaces/cocoa/cocoaprivate.pp
U lcl/interfaces/cocoa/cocoawscommon.pas
U lcl/lclstrconsts.pas
U lcl/interfaces/cocoa/
U lcl/interfaces/cocoa/cocoascrollers.pas
U lcl/lmessages.pp
U lcl/include/
U lcl/include/
Updated to revision 58689.

My model is pull down trunk, build 32bit Lazarus and use that to build 64bit apps. I have not, recently, tried the 64bit lazarus build.


2018-08-13 07:18

reporter   ~0110008

see prev note

Dmitry Boyarintsev

2018-08-13 13:36

developer   ~0110013


2018-08-14 05:28

reporter   ~0110024

Yeah, second time I have forgotten about that issue.
Removed .o and .ppu
However, now have issue within the function under discussion, that is ClipboardGetFormats(),5) Error: Wrong number of parameters specified for call to "Move"

    Move(fmt[0], List^, Count * sizeof(TClipboardFormat));

My info is Move only takes 2 parameters. (and incidentally, is marked as Deprecated, not thread safe and maybe Carbon only ??). I guess we are talking about a different Move() ?

Did a fresh svn up and same situation.


Bart Broersma

2018-08-14 08:31

developer   ~0110026

System.Move() perhaps?

Dmitry Boyarintsev

2018-08-14 12:54

developer   ~0110032

you need to revert all you local changes to cocoaint.pas file


2018-08-16 07:38

reporter   ~0110066

Sorry, who needs to revert local changes ? Not me ...

Just pulled down changes since last discussion.

Function GetClipboardFormat() does now seem to bring back a viable list of formats. However, the function returns False.

It appears to me it returns False because CocoaWSClipboard#236 -

function TCocoaWSClipboard.GetFormats(ClipboardType: TClipboardType;
  var Count: integer; var List: TDynClipboardFormatArray): boolean;

does not set its Result if if finds valid data in Pasteboards.

Don't thinks thats right .....

Dmitry Boyarintsev

2018-08-17 01:59

developer   ~0110070

please test and close if ok


2018-08-17 05:53

reporter   ~0110071

Yep, thats fixed !

Tested in my little dummy test app AND tested in my big app.

Thanks Dmitry

Issue History

Date Modified Username Field Change
2018-08-12 06:14 David New Issue
2018-08-12 06:14 David File Added:
2018-08-12 16:38 Dmitry Boyarintsev Fixed in Revision => 58695
2018-08-12 16:38 Dmitry Boyarintsev LazTarget => -
2018-08-12 16:38 Dmitry Boyarintsev Note Added: 0109999
2018-08-12 16:38 Dmitry Boyarintsev Status new => resolved
2018-08-12 16:38 Dmitry Boyarintsev Resolution open => fixed
2018-08-12 16:38 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2018-08-13 07:17 David Note Added: 0110007
2018-08-13 07:18 David Note Added: 0110008
2018-08-13 07:18 David Status resolved => assigned
2018-08-13 07:18 David Resolution fixed => reopened
2018-08-13 13:36 Dmitry Boyarintsev Note Added: 0110013
2018-08-13 13:36 Dmitry Boyarintsev Status assigned => resolved
2018-08-13 13:36 Dmitry Boyarintsev Resolution reopened => fixed
2018-08-14 05:28 David Note Added: 0110024
2018-08-14 05:28 David Status resolved => assigned
2018-08-14 05:28 David Resolution fixed => reopened
2018-08-14 08:31 Bart Broersma Note Added: 0110026
2018-08-14 12:54 Dmitry Boyarintsev Note Added: 0110032
2018-08-14 12:54 Dmitry Boyarintsev Status assigned => resolved
2018-08-14 12:54 Dmitry Boyarintsev Resolution reopened => no change required
2018-08-16 07:38 David Note Added: 0110066
2018-08-16 07:38 David Status resolved => assigned
2018-08-16 07:38 David Resolution no change required => reopened
2018-08-17 01:59 Dmitry Boyarintsev Note Added: 0110070
2018-08-17 01:59 Dmitry Boyarintsev Status assigned => resolved
2018-08-17 01:59 Dmitry Boyarintsev Resolution reopened => fixed
2018-08-17 05:53 David Note Added: 0110071
2018-08-17 05:53 David Status resolved => closed