mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-27 21:33:48 +02:00
Cocoa: fix #40517: eliminate cursor flickering when dragging CustomControl
This commit is contained in:
parent
eb98fcd853
commit
426ee9a730
@ -463,6 +463,8 @@ function NSViewCanFocus(v: NSView): Boolean;
|
||||
|
||||
implementation
|
||||
|
||||
uses CocoaWSCommon;
|
||||
|
||||
function NSObjectIsLCLEnabled(obj: NSObject): Boolean;
|
||||
begin
|
||||
if obj.isKindOfClass(NSView) then
|
||||
@ -862,6 +864,8 @@ end;
|
||||
|
||||
procedure TCocoaCustomControl.mouseDragged(event: NSEvent);
|
||||
begin
|
||||
window.disableCursorRects;
|
||||
|
||||
if not Assigned(callback) or not callback.MouseMove(event) then
|
||||
// calling inherited causes the drag event to be passed to the
|
||||
// parent controls
|
||||
@ -905,6 +909,13 @@ end;
|
||||
|
||||
procedure TCocoaCustomControl.mouseUp(event: NSEvent);
|
||||
begin
|
||||
if not window.areCursorRectsEnabled then
|
||||
begin
|
||||
window.enableCursorRects;
|
||||
window.resetCursorRects;
|
||||
CursorHelper.SetCursorAtMousePos;
|
||||
end;
|
||||
|
||||
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||
inherited mouseUp(event);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user