Flicker reduction #136
Replies: 5 comments 3 replies
-
I am very sorry, but I am stuck with my job work now for about 14 days yet. But I will keep in my head and if I will spare some time, I will try to look at it. |
Beta Was this translation helpful? Give feedback.
-
I have some time to take a look at this so I'll see what I can do. |
Beta Was this translation helpful? Give feedback.
-
SynEdit currently uses a MAX_SCROLL value of 32k and scales the scrollbar values if the scrollbar maxes exceed it. This needs to be done if we rely on the message values in WMVScroll or WMHScroll which are 16bit, however it's recommended in the API docs to use GetScrollInfo instead. I'd like to do that as part of the other changes I'm making. Is there any reason I shouldn't? GetScrollInfo is already used for the eoScrollHintFollows option btw. |
Beta Was this translation helpful? Give feedback.
-
Sorry, but I actually I was wrong on this. Update only paints the invalidated areas, which is OK and the way it should work. Stupidly, I thought that it repaints the whole window. But if we can use this as an opportunity to improve and modernize TCustomSynEdit.UpdateScrollBars that would be great. It still often unnecessarily recreates the scrollbars. By the way the DirectWrite work is coming up nicely. I have almost finished the painting code. More on that later. |
Beta Was this translation helpful? Give feedback.
-
I've got my proposed changes to UpdateScrollbars done, so I'll do a PR soon. The new changes mostly streamline code along with some changes to avoid flickering (especially related to the eoDisableScrollArrows feature combined with eoHideShowScrollbars off and on.) I've tested on Windows 10 and 11 only and it's a bit hard to test with all the possible options. I'm also not 100% sure about a change I made to horizontal scrolling behavior related to eoScrollPastEOL. I'll be interested in any feedback. -Mark |
Beta Was this translation helpful? Give feedback.
-
There have been many optimizations to reduce flicker. One issue that remains is TCustomSynEdit.UpdateScrollBars. Every time it is executed the Update function is called which repaints the whole window.
An further improvement would be to only call update if there is change either in the visibility of the position of the scrollbars.
One would need to call GetScrollBarInfo to check the visibility of the scrollbars (see this) and GetScrollnfo to check the current settings. Then compute the new settings and compare to the old ones. Call Update only if there is a change.
Alternatively one can store the state of the toolbars and compare the new ones with the old ones to decide if there is a change.
@JaFi-cz @MShark67 I am busy with #26 right now. Any chance of having a go at it?
Beta Was this translation helpful? Give feedback.
All reactions