mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 07:39:35 +02:00
carbon: Patch from bug #21737: Carbon Mouse cursor doesn't change until mousemove
git-svn-id: trunk@54395 -
This commit is contained in:
parent
326cad6133
commit
819d1e72cb
@ -26,7 +26,7 @@ uses
|
|||||||
// libs
|
// libs
|
||||||
MacOSAll, Classes, SysUtils,
|
MacOSAll, Classes, SysUtils,
|
||||||
// LCL
|
// LCL
|
||||||
Forms, Controls, Graphics, LCLType, LCLProc,
|
Forms, Controls, Graphics, LCLType, LCLProc, LCLIntf,
|
||||||
// widgetset
|
// widgetset
|
||||||
WSControls, WSLCLClasses,
|
WSControls, WSLCLClasses,
|
||||||
// LCL Carbon
|
// LCL Carbon
|
||||||
@ -317,10 +317,27 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
class procedure TCarbonWSWinControl.SetCursor(const AWinControl: TWinControl;
|
class procedure TCarbonWSWinControl.SetCursor(const AWinControl: TWinControl;
|
||||||
const ACursor: HCursor);
|
const ACursor: HCursor);
|
||||||
|
var
|
||||||
|
HitControl: ControlRef;
|
||||||
|
TopWindow: WindowRef;
|
||||||
|
TopView: HIViewRef;
|
||||||
|
MousePos: HIPoint;
|
||||||
begin
|
begin
|
||||||
if not CheckHandle(AWinControl, Self, 'SetCursor') then Exit;
|
if not CheckHandle(AWinControl, Self, 'SetCursor') then Exit;
|
||||||
|
|
||||||
TCarbonWidget(AWinControl.Handle).SetCursor(ACursor);
|
TCarbonWidget(AWinControl.Handle).SetCursor(ACursor);
|
||||||
|
|
||||||
|
if (Screen.Cursor <> crDefault) then Exit;
|
||||||
|
|
||||||
|
TopWindow := TCarbonWidget(AWinControl.Handle).GetTopParentWindow;
|
||||||
|
TopView := HIViewGetRoot(TopWindow);
|
||||||
|
HIGetMousePosition(kHICoordSpaceView, TopView, MousePos);
|
||||||
|
if OSError(
|
||||||
|
HIViewGetSubviewHit(TopView, MousePos, True, HitControl),
|
||||||
|
Self, 'TCarbonWSWinControl.SetCursor', 'GetSubviewHit') then Exit;
|
||||||
|
|
||||||
|
if HitControl = TCarbonWidget(AWinControl.Handle).Widget then
|
||||||
|
LCLIntf.SetCursor(ACursor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user