Recent

Author Topic: Why does ComboBox flicker?  (Read 925 times)

tetrastes

  • Jr. Member
  • **
  • Posts: 90
Why does ComboBox flicker?
« on: January 08, 2021, 06:58:59 pm »
System: Windows 10 64 bit.
If this simplest project is compiled with the latest stable Lazarus 2.0.10 fpc 3.2.0 (64 or 32 bit, does not matter), ComboBox flickers (and this is bug, IMHO).
If it is compiled with the previous stable Lazarus 2.0.8 fpc 3.0.4, ComboBox does not flicker.
If you change TEdit to TLabel in project, ComboBox does not flicker.

tetrastes

  • Jr. Member
  • **
  • Posts: 90
Re: Why does ComboBox flicker?
« Reply #1 on: January 08, 2021, 09:04:05 pm »
I have tested this at Linux (Fedora 32 64 bit) with Lazarus 2.0.10 fpc 3.2.0 with gtk2 and qt5 widgetsets, and ComboBox does not flicker. So this is LCLwin32 2.0.10 issue (cannot test on Mac).
Just one note: ToggleBox loses focus after clicking on it, and in qt5 app focus returns to ComboBox, which results in some other sort of flickering (but this is not a bug, IMHO :) ).
« Last Edit: January 08, 2021, 09:30:17 pm by tetrastes »

wp

  • Hero Member
  • *****
  • Posts: 8265
Re: Why does ComboBox flicker?
« Reply #2 on: January 08, 2021, 10:08:15 pm »
It is not clear to me how to reproduce this issue. When I run the demo everything is static, no flicker. OK, there is a togglebox, you probably mean that I have to click it (why don't you write that?). OK - I click the toggle box: There is a white box appearing in the combobox for a short time, approximately the size of the focus rectangle (I must press tab some time to focus the combobox and to see the focus rectangle). This happens with Laz 2.0.10, but not with 2.0.8 and not with trunk. So, probably this is your flicker, isn't it? In your sources, there is a Sleep by 200 ms, probably to exaggerate the "flicker"?

It would be easier to understand if you would write more details...

If all this is the flicker that you mean, then my answer would be: Wait for Laz version 2.2 because it seems to be fixed in the trunk version. Maybe the fix has even been back-ported to the fixes branch, but I cannot test this since I do not have a fixes installation atm.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

tetrastes

  • Jr. Member
  • **
  • Posts: 90
Re: Why does ComboBox flicker?
« Reply #3 on: January 09, 2021, 09:04:42 am »
Thank you for the answer, wp!
Yes, this is my "flicker", sorry for bad explanations about ToggleBox (I thought that it was clear from code).
I have noticed it in "real" program, when did some changes and recompiled it with Lazarus 2.0.10. Of course there is no Sleep there, but rather long code. Sleep is only to show the issue in this demo, you are right.
 It's nice that this is fixed in trunk. :)
« Last Edit: January 09, 2021, 11:03:35 am by tetrastes »

fcu

  • Jr. Member
  • **
  • Posts: 69
Re: Why does ComboBox flicker?
« Reply #4 on: March 04, 2021, 09:56:51 pm »
it is fixed , good to hear , but the TTrackBar still flicker .
what is the fix revision for combobox ? , maybe could applied for ttrackbar as well 

 

TinyPortal © 2005-2018