Recent

Author Topic: TListBox flickers when scrolling (laz 1.4.0)  (Read 24847 times)

wp

  • Hero Member
  • *****
  • Posts: 13268
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #15 on: May 20, 2015, 06:07:28 pm »
OK - here's a demo which shows the issue: Compile and run, just drag the scrollbar into the center and then quickly drag it up and down by 1 cm. You'll see occasional flickering of the first and last visible lines. Confirmed with Laz trunk/fpc 2.6.4 and with Laz 1.4/fpc 2.6.4. I can also confirm your observation that this did not occur earlier - I only have Laz 1.2 now, but there is no flicker with this version.

I looked through the svn logs, but did no find an obvious change.

ncs-sniper, please file a bug report, you can attach this demo if you want.

BitBangerUSA

  • Full Member
  • ***
  • Posts: 183
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #16 on: May 20, 2015, 06:41:09 pm »
tested wp's demo with Lazarus 1.2.4 / FPC 2.6.4 / Windows 7 Home Premium 64 bit - no flickering seen.

wp has gone 'above and beyond' on this one.
Lazarus Ver 2.2.6 FPC Ver 3.2.2
Windows 10 Pro 64-bit

wp

  • Hero Member
  • *****
  • Posts: 13268
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #17 on: May 20, 2015, 06:54:16 pm »
Flicker is gone when the listbox responds to the WMEraseBackground message without actually clearing the background - see modified listbox in the right of the form in the attached demo.

BUT: the old version did not catch this message either but is working correctly. The bug must be somewhere else.

balazsszekely

  • Guest
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #18 on: May 20, 2015, 07:05:29 pm »
I give up, I see no difference between listbox1 and listbox2.

ncs-sniper

  • Jr. Member
  • **
  • Posts: 53
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #19 on: May 20, 2015, 07:12:29 pm »
I am glad at least someone was able to reproduce this. Yes, ignoring WMEraseBackground really helps.
I have also created more severe test (items are filled with pseudorandom noise, so redraw takes a lot of processing power and therefore time). Can anyone please test it?

BitBangerUSA

  • Full Member
  • ***
  • Posts: 183
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #20 on: May 20, 2015, 07:24:56 pm »
tested ncs-sniper prog - no flickering seen (run of the mill system) with Laz 1.2.4 / FPC 2.6.4 / Windwos 7 Home 64 bit.
much flickering on high-end system using Laz 1.4.

also got a dialog about heap on stopping the prog on high-end system - i've no clue as to importance.
Lazarus Ver 2.2.6 FPC Ver 3.2.2
Windows 10 Pro 64-bit

wp

  • Hero Member
  • *****
  • Posts: 13268
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #21 on: May 20, 2015, 07:25:32 pm »
Yes, very dramatic effect, and no flicker with Laz 1.2

Quote
also got a dialog about heap on stopping the prog on high-end system - i've no clue as to importance
This is because heap trace is checked in the compiler options (Project options / Compiler options / Debugging / Use heaptrc unit...)
« Last Edit: May 20, 2015, 07:28:40 pm by wp »

ncs-sniper

  • Jr. Member
  • **
  • Posts: 53
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #22 on: May 20, 2015, 07:29:25 pm »
BitBangerUSA - it is set to be compiled in debug mode with heap tracking, that is why the window shows up. Just ignore it.
So at least two other users can see it too. Thanks for testing!

BitBangerUSA

  • Full Member
  • ***
  • Posts: 183
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #23 on: May 20, 2015, 07:34:54 pm »
wp and ncs-sniper - thanks for the info - i hadn't looked...
Lazarus Ver 2.2.6 FPC Ver 3.2.2
Windows 10 Pro 64-bit

airpas

  • Full Member
  • ***
  • Posts: 179
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #24 on: May 20, 2015, 07:52:31 pm »
i see annoying flickering while scrolling or resizing the window , i use lazarus 1.5 / fpc 3.1.1 win7 32bits
also when using splitters too ,  i filed a report about that while ago

wp

  • Hero Member
  • *****
  • Posts: 13268
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #25 on: May 20, 2015, 09:19:14 pm »
airpas, I think your issue is different. It was reported for Laz 1.0.11 - I still have a 1.0 version lying around which does not show the listbox flicker.

airpas

  • Full Member
  • ***
  • Posts: 179
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #26 on: May 20, 2015, 09:39:44 pm »
my issue was with splitter .
i think the problem of flickering present in windows only . lcl-gtk/qt seems fine
 

wp

  • Hero Member
  • *****
  • Posts: 13268
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #27 on: May 20, 2015, 10:16:47 pm »
In r47451, a lot of work was done with the EraseBackground message in January. Maybe the bug slipped in this way.

I filed a bug report http://bugs.freepascal.org/view.php?id=28146

ncs-sniper

  • Jr. Member
  • **
  • Posts: 53
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #28 on: May 20, 2015, 11:10:34 pm »
Many thanks for filing that bug report!
I have again tried it in linux (Lubuntu) - just to be sure, this time with the noise. And no, it really does not happen in linux.

ncs-sniper

  • Jr. Member
  • **
  • Posts: 53
Re: TListBox flickers when scrolling (laz 1.4.0)
« Reply #29 on: May 22, 2015, 11:33:35 pm »
I am watching the bug report (http://bugs.freepascal.org/view.php?id=28146) - catching the WM_EraseBackground does not solve it, it just hides it. I have tried this solution with interposer for TListBox in my project mentioned in the first post, and it does not flicker only because the individual items are very similar. If you have items that are visually distinct, it will flicker again (or better put, will produce artifacts).

 

TinyPortal © 2005-2018