mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 01:48:03 +02:00
lcl: TForm.ShowModal: override temporary cursors with Screen.Cursor and not crDefault. Issue #39486
This commit is contained in:
parent
738e48c6b7
commit
d13c67e680
@ -235,6 +235,7 @@ const
|
||||
crSizeAll = TCursor(-22);
|
||||
|
||||
crLow = TCursor(-30);
|
||||
crScreenCursor= Low(TCursor); // use only with Screen.BeginTempCursor/EndTempCursor to force Screen.Cursor
|
||||
|
||||
type
|
||||
TCaptureMouseButtons = set of TMouseButton;
|
||||
|
@ -2948,7 +2948,7 @@ begin
|
||||
Screen.FSaveFocusedList.Insert(0, Screen.FFocusedForm);
|
||||
Screen.FFocusedForm := Self;
|
||||
Screen.MoveFormToFocusFront(Self);
|
||||
Screen.BeginTempCursor(crDefault);
|
||||
Screen.BeginTempCursor(crScreenCursor);
|
||||
ModalResult := 0;
|
||||
|
||||
try
|
||||
@ -3006,7 +3006,7 @@ begin
|
||||
end;
|
||||
finally
|
||||
RestoreFocusState(SavedFocusState);
|
||||
Screen.EndTempCursor(crDefault);
|
||||
Screen.EndTempCursor(crScreenCursor);
|
||||
if LCLIntf.IsWindow(ActiveWindow) then
|
||||
SetActiveWindow(ActiveWindow);
|
||||
Exclude(FFormState, fsModal);
|
||||
|
@ -857,10 +857,13 @@ end;
|
||||
|
||||
function TScreen.GetRealCursor: TCursor;
|
||||
begin
|
||||
if Length(FTempCursors)>0 then
|
||||
if (Length(FTempCursors)>0) and (FTempCursors[High(FTempCursors)]<>crScreenCursor) then
|
||||
Result := FTempCursors[High(FTempCursors)]
|
||||
else
|
||||
Result := Cursor;
|
||||
if Cursor<>crScreenCursor then
|
||||
Result := Cursor
|
||||
else // Screen.Cursor=crScreenCursor - we have to use crDefault because crScreenCursor is otherwise invalid
|
||||
Result := crDefault;
|
||||
end;
|
||||
|
||||
function TScreen.GetSystemFont: TFont;
|
||||
|
Loading…
Reference in New Issue
Block a user