cocoa: update InitClipboard to initialize the internal structure for monitoring pasteboards

git-svn-id: trunk@58689 -
This commit is contained in:
dmitry 2018-08-11 17:19:45 +00:00
parent 8727f02d27
commit c9171d1916

View File

@ -150,10 +150,20 @@ begin
end;
procedure TCocoaWidgetSet.InitClipboard;
var
t : TClipboardType;
begin
PrimarySelection := NSPasteboard.pasteboardWithUniqueName();
SecondarySelection := NSPasteboard.pasteboardWithUniqueName();
ClipboardFormats := TFPObjectList.Create(True);
Pasteboards[ctPrimarySelection].pasteboard := PrimarySelection;
Pasteboards[ctSecondarySelection].pasteboard := SecondarySelection;
Pasteboards[ctClipboard].pasteboard := NSPasteboard.generalPasteboard;
for t := Low(TClipboardType) to High(TClipboardType) do
if Assigned(Pasteboards[t].pasteboard) then
Pasteboards[t].changeCount := Pasteboards[t].pasteboard.changeCount;
end;
procedure TCocoaWidgetSet.FreeClipboard;