This is surely not a Lazarus issue but more a "howto", but i raise it because it might be of interest for others too.
For to have a special drag image on a custom treeview, i'd be using successfully
a TMyDragObject from class TDragControlObjectEx.
At the beginning i had a flicker issue using it. I avoided that by applying LockWindowUpdate (somehow similar: BeginUpdate/EndUpdate).
DirTreeDoOnStartDrag
DragObject := TMyDragObject.CreateWith(Sender as TControl, FTvImageList, imgidx, aText); // without this, no flicker
LockWindowUpdate(Handle); // without this, flicker when using "TMyDragObject"
DirTreeDoOnEndDrag
LockWindowUpdate(0);
..................
Now, for other things i'd like to do i need to revoke this special LockWindowUpdate. And so the flicker issue does reappear at each mouse move.
Unfortunately, i don't see the flicker issue with a simple test project,
So i tracked down the coding in my app step by step. Nulling out by "exit"s in nearly every procedure that may interfere and cause side effects.
But even using "exit" as only statement within "DragOver" causes screen repainting on each dragging mouse move.
All components involved are doublebuffered.
Meanwhile i'm missing ideas why a simple “create a TDragControlObjectEx could be sufficient to cause flicker even the DragOver event callback is empty.
So i'd like to ask if somebody yet did encounter something similar and did solve it other than using LockWindowUpdate.
Every idea about possible causes is welcome. Why TDragControlObjectEx might cause repeated repaints?
Vice versa: is it possible to enforce a repaint of a single node although a LockWindowUpdate had been done? (probably not, but that would allow to keep the LockWindowUpdate)
PS: in this crenario, the drag is a node drag inside the treeview only. - Potential scrolling does not play a role.