Skip to content

Commit 02ecead

Browse files
committed
FIX: the issue that clicking a file to rename on macOS
1 parent 65936a4 commit 02ecead

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/fileviews/ufileviewwithmainctrl.pas

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ TFileViewWithMainCtrl = class(TOrderedFileView)
146146
tmRenameFile: TTimer;
147147
FMouseRename: Boolean;
148148
FMouseFocus: Boolean;
149-
{$IFNDEF LCLWIN32}
149+
{$IF NOT (DEFINED(LCLWIN32) and DEFINED(LCLCOCOA))}
150150
FMouseEnter: Boolean;
151151
{$ENDIF}
152152
procedure AfterChangePath; override;
@@ -895,7 +895,10 @@ procedure TFileViewWithMainCtrl.MainControlEndDrag(Sender, Target: TObject; X, Y
895895
procedure TFileViewWithMainCtrl.MainControlEnter(Sender: TObject);
896896
begin
897897
Active := True;
898-
{$IFNDEF LCLWIN32}
898+
{$IFDEF LCLCOCOA}
899+
FMouseRename := gInplaceRename;
900+
{$ENDIF}
901+
{$IF NOT (DEFINED(LCLWIN32) and DEFINED(LCLCOCOA))}
899902
FMouseEnter:= ssLeft in GetKeyShiftStateEx;
900903
{$ENDIF}
901904
end;
@@ -1683,7 +1686,9 @@ procedure TFileViewWithMainCtrl.edtRenameExit(Sender: TObject);
16831686

16841687
// OnEnter don't called automatically (bug?)
16851688
// TODO: Check on which widgetset/OS this is needed.
1689+
{$IF NOT DEFINED(LCLCOCOA)}
16861690
FMainControl.OnEnter(Self);
1691+
{$ENDIF}
16871692
end;
16881693

16891694
procedure TFileViewWithMainCtrl.edtRenameButtonClick(Sender: TObject);

0 commit comments

Comments
 (0)