delayed execution of SetCursor => e.g. Synedit MouseLinks
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
Only tested under windows.
If A visual component (like SynEdit) calls SetCursor the change is delayed until the cursor moves.
How to repeat:
- In Synedit position the cursor over a word.
- press CTRL (do NOT move the mouse)
=> The word is now highlighted as MouseLink
=> the cursor has not changed
- Move the mouse by a few pixel (keeping it over the same word)
=> The cursor now shows the Hand Symbol
- Release the CTRL key (do NOT move the mouse)
=> The word is no longer highlighted
=> The mouse is still the hand symbol
- move the mouse
=> cursor returns to normal
Additional information:
This is because SetCursor does only set the internal cursor. The call to windows API is only made on receival of WM_SETCURSOR (which is on mouse movement)
in lcl\interfaces\win32\win32wscontrols.pp line 485
class procedure TWin32WSWinControl.SetCursor(const AWinControl: TWinControl;
const ACursor: HCursor);
begin
// in win32 controls have no cursor property. they can change their cursor
// by listening WM_SETCURSOR and adjusting global cursor
if csDesigning in AWinControl.ComponentState then
Windows.SetCursor(ACursor);
end;
During runtime csDesign is NOT in componetState.
Maybe there should be a trigger of a WM_SETCURSOR message if it is not in csDesign?
Mantis conversion info:
- Mantis ID: 11700
- Version: 0.9.25 (SVN)
- Fixed in version: 0.9.27 (SVN)
- Target version: 0.9.28
- LazTarget: 1.4