Painting artefacts for TEdit controls on Win-11
- Lazarus/FPC Version: Lazarus 2.3.0 (rev main-2_3-693-g92be3d69) FPC 3.2.2 i386-win32-win32/win64
- Operating System: Windows 11 (only)
- CPU / Bitness: 32 or 64 bit
In Windows 11 the painting style of edit controls was changed. While it had a simple border earlier it is now painted with a bright gray border at the left, top and right edges and a thicker bright blue line at the bottom edge when focused; the bottom line becomes a thicker gray when the edit is not focused.
The LCL TEdit has a painting issue with this new style now. Sometimes the border of the control is painted in dark gray on all sides, sometimes only part of a side is painted correctly, sometimes the border is a thick dark line. And I also saw a case when the blue bottom line appeared at the top.
Delphi applications on Win-11 do not show this issue (tested Delphi XE 10.3.3 CE, as well as Delphi 7 w/XPMan).
What did you expect
Consistent painting of the TEdit control
Steps to reproduce
Create a new project on a Windows-11 machine
Drop two TEdit controls on the form
Compile and run
Initial state: correct
Press TAB to focus the other edit control: Both controls show an incorrectly painted border. Note the dark border in the screenshot. Drag the form beyond the left edge of the monitor so that at least part of the edits is no longer visible; then drag the form back so that everything is fully visible again --> the borders changed. Press the ALT key --> the borders change again.
For comparison, the screen shot from Delphi after tabbing to focus Edit2. The borders are like in the initial state. They also do not change when the form is repainted.