Recent

Author Topic: [SOLVED] Parasitic cursor in code editor.  (Read 6760 times)

BrunoK

  • Sr. Member
  • ****
  • Posts: 452
  • Retired programmer
Re: Parasitic cursor in code editor.
« Reply #15 on: November 18, 2018, 09:53:36 pm »
@Martin_fr

In options, caret :

(NotXor) + Black  -> Seems to works as the default cursor should. Maybe that might help figure out the problem.

Will try your revision tomorrow.

Thanks for your efforts.

BrunoK

  • Sr. Member
  • ****
  • Posts: 452
  • Retired programmer
[SOLVED] Parasitic cursor in code editor.
« Reply #16 on: November 19, 2018, 12:02:48 pm »
@Martin_fr

1° r59596 WORKS, thank you !

2° Personal >SPECULATION< on potential change of behaviour in Windows 10

Your patch creates a (some_width by one_pixel_height) invalidated region.

MAYBE, Windows 10 ignores empty rectangles and don't call WM_PAINT for empty rectangles.

Note : I havent found anything browsing the net that would confirm this idea.

I have modified .\lcl\interfaces\win32\win32winapi.inc for debugging to
Code: Pascal  [Select][+][-]
  1. function TWin32WidgetSet.InvalidateRect(AHandle: HWND; Rect: PRect;
  2.   BErase: Boolean): Boolean;
  3. var
  4.   Flags: UINT;
  5.   ORect: TRect;
  6. begin
  7.   Flags := RDW_INVALIDATE or RDW_ALLCHILDREN;
  8.   if BErase then
  9.     Flags := Flags or RDW_ERASE;
  10.   if Rect <> nil then
  11.   begin
  12.     with Rect^ do                                      // ~bk dbg
  13.       if (Right<=Left) or (Bottom<=Top) then           // ~bk dbg
  14.         Right:=Right;                                  // ~bk dbg  <- Breakpoint : frequently stops here
  15.     GetLCLClientBoundsOffset(aHandle, ORect);
  16.     OffsetRect(Rect^, ORect.Left, ORect.Top);
  17.   end;
  18.   Result := Boolean(Windows.RedrawWindow(aHandle, Rect, 0, Flags));
  19. end;

// ~bk dbg  <- Breakpoint : frequently stops here
does effectively stop quite frequently from SynEdit and co.

Just my 2 cents ...

BrunoK

  • Sr. Member
  • ****
  • Posts: 452
  • Retired programmer
Re: [SOLVED] Parasitic cursor in code editor.
« Reply #17 on: November 19, 2018, 12:16:18 pm »
Oh yes, I forgot to say it is really WINDOWS 10 specific and not due to recent changes because my Lazarus 1.4.4 + FPC 2.6.4 shows the same behaviour as my top post.

 

TinyPortal © 2005-2018