Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VT Header draws smudged (see screenshot) #248

Closed
vincentparrett opened this issue Jan 21, 2015 · 42 comments
Closed

VT Header draws smudged (see screenshot) #248

vincentparrett opened this issue Jan 21, 2015 · 42 comments
Assignees
Milestone

Comments

@vincentparrett
Copy link
Contributor

@vincentparrett vincentparrett commented Jan 21, 2015

From danielfr...@gmail.com on December 19, 2011 22:14:37

I recall VT's painting to be quite smooth when I used it in D7 (with Mike's releases). Now, the painting, when dragging a column, seems to be really lagging behind, and sometimes when you click on the column header and drag really quickly, you get a smudge (see screenshot). I disabled theme awareness; same problem (speaking of theme awareness, even when it was off, the XP mode was a really nice feature, now gone).

Attachment: vt2.png

Original issue: http://code.google.com/p/virtual-treeview/issues/detail?id=248

@vincentparrett

This comment has been minimized.

Copy link
Contributor Author

@vincentparrett vincentparrett commented Jan 21, 2015

From joachim....@gmail.com on December 23, 2014 14:02:39

Is the problem still there in V5.5.1?

@vincentparrett

This comment has been minimized.

Copy link
Contributor Author

@vincentparrett vincentparrett commented Jan 21, 2015

From ricardo....@gmail.com on January 06, 2015 18:48:51

This fail draw occurs on 5.52 too. When you try to change column order, and mantains cursor in vertical header range the control draws a piece in selececter column color. any solution at this moment?

@vincentparrett

This comment has been minimized.

Copy link
Contributor Author

@vincentparrett vincentparrett commented Jan 21, 2015

From joachim....@gmail.com on January 08, 2015 10:44:58

I'm sorry, no solution from me. I personally never worked in this part of the code so far.

@vincentparrett

This comment has been minimized.

Copy link
Contributor Author

@vincentparrett vincentparrett commented Jan 21, 2015

From ricardo....@gmail.com on January 08, 2015 16:23:02

Thanks any way, last thing, do you have any clue where can I start to find this bug?, or can you contact the person that work in this behavior.

@vincentparrett

This comment has been minimized.

Copy link
Contributor Author

@vincentparrett vincentparrett commented Jan 21, 2015

From danielfr...@gmail.com on January 09, 2015 04:02:38

Let me check if this is still the case - will get back to you ASAP.

@vincentparrett

This comment has been minimized.

Copy link
Contributor Author

@vincentparrett vincentparrett commented Jan 21, 2015

From ricardo....@gmail.com on January 14, 2015 17:09:41

Ok, I found a "more or less" solution.
The problem is first capture of the dragging button, in the TVTHeader.HandleHeaderMouseMove make the correct operation, changing DownIndex to NoColumn, and redrawing the header with an Invalidate but it need a direct repaint, not an invalidate, so, the code captures the header button before repaint the button in release state (the WMessage is processed later).

The solution is in TVTHeader.HandleHeaderMouseMove line 12572 in v5.52, you need to add an treview.update after invalidate, then process pending messages before call preparedrag and capture the blue button for background.

Change this ---->

if I > NoColumn then
Invalidate(FColumns[I]);

with this ---->

if I > NoColumn then begin
Invalidate(FColumns[I]);
Treeview.Update;
end;

The problem with a lagging draw is not corrected, but that is another problem, slow folow the mouse cursor and a lor of blinking, and seems that text move into dragable button. Now beautiful to see.

@vincentparrett

This comment has been minimized.

Copy link
Contributor Author

@vincentparrett vincentparrett commented Jan 21, 2015

From ricardo....@gmail.com on January 15, 2015 09:40:55

This code (draw on drag, this is an incredible control anyway) seems to be very buggy. Another thing with simply solution is when you drag one column not show dragcursor, to solve this, insert Windows.SetCursor(Screen.Cursors[self.DragCursor]); in first line after begin in DoHeaderDragging method.

@joachimmarder joachimmarder self-assigned this Mar 25, 2015
@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Jan 19, 2016

At this moment this problem continues, do anyone know something more about this?

@joachimmarder

This comment has been minimized.

Copy link
Contributor

@joachimmarder joachimmarder commented Jan 19, 2016

Do you have simple repro steps for this issue with one of the sample projects?

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Jan 20, 2016

Yes, it fails always when move any hader tab. For example in advanced demo, four button.
sin titulo

Try dragging over header.

I remove that blue piece adding and update on HandleHeaderMouseMove method, but this ugly behavior continues in latest version, any way the drag operation shows lagging and blinking.
The control show good, but not in this case.

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Jan 22, 2016

There are another problem with circled arrow icons that paint on the sides of header buttons, they are cropped, some times it's now drawed other ones remain drawed, buf.

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Jul 11, 2016

I can't seem to reproduce this problem on my Win 10 and Win 7. The screenshot above where the "Column3" is smudged--was it a VM being used?

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Jul 29, 2016

The problem was reproduced on windows 7 ultimate clean installation, not in VM (yes I test on a VM windows 8 and one VM windows XP (I know, XP...). And fail in all of them, persistent error. I compile it with delphi XE7 and XE3.

Only pick column and move it from left to right and viceversa some times and problem arise. If you need that I make more test, please tellme.

Upper capture was with unmodified demo app.

Another one from a vcl styles app.

image

sanjayssk pushed a commit that referenced this issue Aug 3, 2016
Smudging was occuring because the partial header caption copied as a backup image by Dragimage object was a pressed caption whereas the rest of the caption was released during the drag to be drawn non-pressed, causing a misalignment.
@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Aug 3, 2016

Please test with the latest commit and confirm that the problem is solved.

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Aug 4, 2016

Worst,

image

I download latest version from github (thursday 4/08/2016) and the icons seems to be more affected, this time some icons or pices of them appear in others colums headers (look at left of "Localidad").

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Aug 4, 2016

The issue is originally about smudged header caption in the first screenshot. Please check if that problem is solved. The problem of icons might be related to different part of the code and may need another solution so it needs to be pushed to another issue.

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Aug 4, 2016

Yes, it's exactly the same, capture of demo with last versión of VT

image

drag operation shows lagging and blinking now too.

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Aug 4, 2016

Please look again carefully. In the earlier screenshot, the caption of the source "column3" is distorted.
image

In the new screenshot, it's properly aligned.
image

That's the problem that has been solved.

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Aug 4, 2016

ok, it is aligned, but continue smudge, blue parts drawing anywhere, draw very laggy, blinking and "eat" the position icons. vincentparrett don't talk anytime about align.

Sorry, but I think there are a serious problem when drag the header, I don't think the align is the worst one.

@vincentparrett

This comment has been minimized.

Copy link
Contributor Author

@vincentparrett vincentparrett commented Aug 4, 2016

FWIW, I am not the original reporter of this issue, my name was added by github because I imported the repo from googlecode.

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Aug 4, 2016

It takes several attempts to produce that kind of caption distortion. The fact that it's included in the original screenshot means it was shown as the main problem to be tackled. It stands out in that screenshot.

Let's see what Joachim decides.

It might be better if the issue is broken into multiple parts because there seem to be multiple problems with dragging and the relevant code might be different for each problem. Then the priority can be assigned based on the seriousness as perceived by Joachim. Besides, some of these problems may be unsolvable unless the drag class is redesigned.

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Aug 4, 2016

Ok, thanks for your work and for the response, I understand.

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Aug 4, 2016

Thank you for your help in testing and for reporting problems.

@joachimmarder

This comment has been minimized.

Copy link
Contributor

@joachimmarder joachimmarder commented Aug 4, 2016

It might be better if the issue is broken into multiple parts

I case the cause and the resolutions are different for the various parts, I vote for separating them. If cause and resolution are similar, we should keep it in a single issue.

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Aug 5, 2016

I also found a usage issue for header drop marks. When the dragged column is not going to change position, no drop mark should appear. Currently it does. To recreate, drag a column a little to the left column (below the header). A drop mark still appears on the right of left column header even though the current column will not be dragged. Similar problem with the right drag. Is this correct usage behavior?

According to me, it shouldn't. No drop mark should appear unless the column is going to change position. Please give your thoughts on this. Thanks.

@joachimmarder

This comment has been minimized.

Copy link
Contributor

@joachimmarder joachimmarder commented Aug 5, 2016

No drop mark should appear unless the column is going to change position.

I agree. You may open a separate issue at GitHub for this.

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Aug 6, 2016

The dropmark icon drawing problems in this issue are related to a missing function in the TVTHeader class that should have been there similar to UpdateWindowAndDragImage in TBaseVirtualTree. Basically, during a drag, only the drop marks appear or go. At that instant, the above type of function should be used to redraw the changed header into the drag image's backup image to solve the problem.

Currently what happens is that the backup header image is captured without the drop mark and then restored after the drop mark appears and image is dragged, causing part of the drop mark to disappear.

Will work on that function next.

sanjayssk pushed a commit that referenced this issue Aug 17, 2016
Smudging occured due to the way drag code is designed that restores a prior image of the header captured in its backup and causes the smudge. This also produces a distorted caption sometimes. The fix involves doing a repaint of the header rect in TVTHeader.DragTo if the function is not already doing a repaint of the specific column. This also fixed the earlier distorted caption problem and the separate fix for that problem committed earlier is not needed any more and is reversed in this source. However, some more testing is needed by the users who reported this to make sure that it works OK now.
@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Aug 17, 2016

I just committed a fix for this header smudge problem. Please test it and let me know whether it works better.

Thanks.

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Aug 20, 2016

I download latest version today, and sorry, but worst.

image

Blinking is higher and many times background is drawed over drag object. In the image the dragged object is under col 1 header. This behavior doesn't occur in previous version.

I only can say thanks by this control and I hope you forgive me, but I think all this artifacts are all in one point, the code that draws the dragging object and restore background is buggy.

Some comments above I talk about add an update aften an invalidate, I know, I update entire treview, so I am shooting a fly with a canon, but the problem goes better. I think thak mouse move events capture background before invalidate in mesage queue is procesed, so, background is corrupted.

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Aug 22, 2016

I can't see any difference in blinking from previous to this one. The blinking occurs only when the drag goes over a new column. That is same as before. Are you using a VM? I'm not using a VM.

many times background is drawed over drag object

Whatever I do, I can't recreate that problem. Can you give me steps to recreate the problem shown in the screenshot? Also tell whether you are using a VM.

Thanks.

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Aug 22, 2016

Hello, no I'm using an q9550 with ati 6870, Windows 7 64bits, no vm. I tested today in other two pc with windows 7 and one more with windows 8, same problem in all of them. I only catch a column header and displace to the left over other columns. In deed i can only see that works well on windows XP but I read the code and in xp use other mechanism.

Tomorrow I'm goint to prepare a windows 10 machine ( no vm) and test too, i'll send a capture

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Aug 24, 2016

OK. I got it now why I'm not seeing the same problems as you. All this time, I have been testing under Windows 10, assuming that it's same underneath as Windows 7, at least for win32 apps. In Windows 10, the fix works quite well and I can't duplicate that problem at all. But after your message, I just tested on an old Windows 7 laptop, and I can duplicate the problem of drag image going under immediately.

So it seems, Microsoft seems to have done some work under the hood in Windows 10. It's different after all, even for Win32.

Thanks.

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Aug 25, 2016

Yes, it behavior it's different depending on windows version. In windows 10 less lagging (many anyway), don't paint behind header, but cut position indicators.

image

sanjayssk pushed a commit that referenced this issue Sep 6, 2016
* The blue rectangles and delay no longer occurs
* The partial dropmarks painting is fixed
* Earlier fix is reverted and replaced with new fix
The fix involved a change in the function UpdateWindowAndDragImage
in order to allow its use for the dragimage object used in header.
@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Sep 6, 2016

Well, I have made some major changes to fix this issue. I tested this time on Windows 7 too. I no longer see the blue rectangles, delay and partial drop marks being painted. Please use the latest commit to test the fix and let me know if you still see any problems.

Thanks.

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Sep 13, 2016

I'm closing this issue. If you happen to still find any related problem, please open it again. Thanks.

@sanjayssk sanjayssk closed this Sep 13, 2016
@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Sep 13, 2016

I can’t test it, latest build is not installable on Delphi XE7. I open Issue #655

@joachimmarder

This comment has been minimized.

Copy link
Contributor

@joachimmarder joachimmarder commented Sep 14, 2016

Sorry, #655 is fixed now.

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Sep 14, 2016

Sorry but


El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
https://www.avast.com/antivirus

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Sep 14, 2016

Sorry but the problem continues although only occurs when move the header for some time, it is near to work indeed.

image

This capture is from just now, with the latest build.

It is much more difficult to reproduce the error, but it is possible now in windows 7.

The position icon is cutoff.

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Sep 15, 2016

Thank you for testing. Can you explain what you mean by position icon is cutoff? If you mean the DropMark on the left, it was a bug. Dropmark should not appear if the column is not going to change position. See issue #643. Other than that, please give more details on what problem you see. Thanks.

@RicardoBer

This comment has been minimized.

Copy link

@RicardoBer RicardoBer commented Sep 15, 2016

No, thanks to you, awesome work,

Ok, In that capture I move the Column 3 between "column" and "Column1" if you look on top of "C" letter of Column 1 you can see a piece of the Dropmark.

@sanjayssk

This comment has been minimized.

Copy link
Contributor

@sanjayssk sanjayssk commented Sep 15, 2016

I see now. I saw the problem in painting C but didn't realize it was a drop
mark that was causing it. Thanks for catching that.

On Thu, Sep 15, 2016 at 7:50 AM, RicardoBer notifications@github.com
wrote:

No, thanks to you, awesome work,

Ok, In that capture I move the Column 3 between "column" and "Column1" if
you look on top of "C" letter of Column 1 you can see a piece of the
Dropmark.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#248 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATX-xmYai6nENJIz0WoKRZnpFg79lsKnks5qqKtggaJpZM4DVOXT
.

ValtsS added a commit to ValtsS/Virtual-TreeView that referenced this issue Jan 25, 2019
…uring a drag

Smudging was occuring because the partial header caption copied as a backup image by Dragimage object was a pressed caption whereas the rest of the caption was released during the drag to be drawn non-pressed, causing a misalignment.
ValtsS added a commit to ValtsS/Virtual-TreeView that referenced this issue Jan 25, 2019
…uring a drag

Smudging occured due to the way drag code is designed that restores a prior image of the header captured in its backup and causes the smudge. This also produces a distorted caption sometimes. The fix involves doing a repaint of the header rect in TVTHeader.DragTo if the function is not already doing a repaint of the specific column. This also fixed the earlier distorted caption problem and the separate fix for that problem committed earlier is not needed any more and is reversed in this source. However, some more testing is needed by the users who reported this to make sure that it works OK now.

# Conflicts:
#	CHANGES.txt
ValtsS added a commit to ValtsS/Virtual-TreeView that referenced this issue Jan 25, 2019
* The blue rectangles and delay no longer occurs
* The partial dropmarks painting is fixed
* Earlier fix is reverted and replaced with new fix
The fix involved a change in the function UpdateWindowAndDragImage
in order to allow its use for the dragimage object used in header.

# Conflicts:
#	Source/VirtualTrees.pas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.