Visual artefacts in TEdit controls lazarus / 31-LCL ---------------------------------------------------------------------- plashenkov · 2013-02-22 18:56 Hello! Did you notice strange black dots when using TEdit controls? They look like visual artefacts and appear in Windows 7 when focusing and unfocusing TEdit controls. Sometimes they appear, sometimes do not, but they quite visible. Please see the attached screenshot (they can be more visible than showed here). Maybe there are some workaround to hide them? These dots do not appear in TComboBox or TSpinEdit, but are very visible for TEdits. ---------------------------------------------------------------------- howardpc · 2013-02-22 19:09 AFAIK edit controls are drawn by the LCL using the native widget on each platform. Perhaps what you see on Windows is theme-related? For instance, do you have perhaps some level of Aero transparency that lets some underlying pixels show through? ---------------------------------------------------------------------- plashenkov · 2013-02-23 08:59 Aero transparency... Well, other windows (non-Lazarus, which are also native) do not have such dots. They appear only in Lazarus applications with default properties, whithout changing alpha transparency, etc. They are also visible in Lazarus IDE dialogs. Just create new form, place some TEdit controls, compile, click between them --- and dots will appear. I noticed that if to Invalidate the parent control --- dots disappear, i.e. they are pained on parent control's context. And TComboBox as well as TSpinEdit do not have this issue in spite of the fact they look very similar. ---------------------------------------------------------------------- Bart · 2013-02-23 11:50 I don't have that on Win7-64 (32-bit Lazarus 1.1/fpc 2.6.2RC). But then again, I'v turned the aero glass feature off, because I find it irritating. Bart ---------------------------------------------------------------------- Martin_fr · 2013-02-23 12:50 I can confirm this on Vista. With and without Aero. The best way I found to reproduce it, and yet it's not 100%, is to have a form, with only 2 edits. Then (when running) use tab twice  quickly to change from edit1 to edit2, and back immediately. It may be to do with the fade-in/out animation of the border. --- Should be reported on Mantis ---------------------------------------------------------------------- plashenkov · 2013-02-23 16:33 The problem is reproduced (for me) with and without Aero, as well as for basic theme. Reported on Mantis: http://bugs.freepascal.org/view.php?id=23942 If someone can suggest a workaround for this, it would be great! ---------------------------------------------------------------------- plashenkov · 2013-02-24 20:15 If in TWin32WSCustomEdit.CreateHandle to write: Params.SubClassWndProc := nil; Then artefacts disappear (as well as all control's events stop working). Something inside Win32Int.WindowProc causes the dots to appear. Maybe parent DC under TEdit does not redraw because thinks TEdit is a solid rectangle, and therefore there is no need to repaint itself under TEdit. Well, I do not know... ---------------------------------------------------------------------- Martin_fr · 2013-02-24 21:32 I don't know that code very well either. But it is possible, that there is an issue with WM_EraseBackground. Maybe in combination with the build in doublebuffering. It may also be that it is only happening due to the animation, and therefore paint events of several buttons being processed. Search for DBG_SendPaintMessage, DEBUG_DOUBLEBUFFER in lcl/interfaces/win32/win32callback.inc I am not really the expert on that code, and busy with a lot of other stuff now. So I wont be doing anything on that.