WinMerge / winmerge

WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.
https://winmerge.org/
GNU General Public License v2.0
6.62k stars 808 forks source link

Compare windows scrolling is broken #1321

Open ciprianmp opened 2 years ago

ciprianmp commented 2 years ago

Whenever I scroll 2 files side by side, the content of both files gets scrambled and very hard to read. Only the lines which I click on or select get to display the right text, the rest of the window shows fragments of random parts. It never happened to me in WinMerge, but it did happen on other computers, i.e. on excel scrolling.

sdottaka commented 2 years ago

Does the problem occur with any file?

ciprianmp commented 2 years ago

Yes, it seems so. At least with php files I have tried. It did the same with version 2.16.16.0 and 2.16.20.0.

sdottaka commented 2 years ago

Thank you for the info.

The /noprefs command line option from the command prompt will start WinMerge with default settings.

"c:\Program Files\WinMerge\WinMergeU.exe" /noprefs

If you open that PHP files in WinMerge started with this option, does the problem reproduce?

ciprianmp commented 2 years ago

Sorry for the delayed reply, I was at work.

I just tried that, it has the same behavior. The settings seem reset, as there are no line numbers anymore, so I guess noprefs had effect.

What happens is, after I open the comparison window, when scrolling down (or up afterwards), only the last 3 lines of both windows show scrolling. If I click refresh (F5), then the right content is displayed, not the scrambled version. Or if I click/select portions of the text. If helpful, I can provide a Teamviewer session with you or I can try to videoshot what happens exactly (not sure how best to do that yet though).

ciprianmp commented 2 years ago

https://user-images.githubusercontent.com/746485/166520036-2afb2a05-44bc-4998-8c95-f7f1df998ef2.mp4

Here's a video screenshot.

sdottaka commented 2 years ago

Thank you for capturing the screenshot video.

It looks like a problem when scrolling with the mouse wheel. We need to be able to reproduce this issue in order for us to fix WinMerge. Please let us know if you know the conditions for reproducing this problem.

ciprianmp commented 2 years ago

I am not sure it's WinMerge fault. It is something similar to these threads: https://answers.microsoft.com/en-us/windows/forum/all/why-does-my-document-scramble-when-i-scroll-up/88337182-6e97-4b5c-b32c-5858261a9de1 https://support.google.com/chrome/thread/2353765/text-is-jumbled-and-distorted?hl=en

It seems to be related to hardware acceleration or a driver issue.

Gitoffthelawn commented 2 years ago

@ciprianmp I use an application that has scrolling issues in Windows. Some text areas don't scroll at all with the mouse wheel. That application uses wxWidgets. WinMerge, on the other hand, works well for me.

The reason I post is 2-fold:

  1. What you describe does sound like a hardware acceleration or driver issue, but if it can be reliably reproduced, perhaps a workaround can be found/created (in WinMerge or in Windows itself).
  2. If you ever fix your issue (regardless of the cause, or the solution), I'm interested in reading about how you fix it. Maybe it will help me fix the issue I experience in the other application.
ciprianmp commented 2 years ago

@ciprianmp I use an application that has scrolling issues in Windows. Some text areas don't scroll at all with the mouse wheel. That application uses wxWidgets. WinMerge, on the other hand, works well for me.

The reason I post is 2-fold:

  1. What you describe does sound like a hardware acceleration or driver issue, but if it can be reliably reproduced, perhaps a workaround can be found/created (in WinMerge or in Windows itself).
  2. If you ever fix your issue (regardless of the cause, or the solution), I'm interested in reading about how you fix it. Maybe it will help me fix the issue I experience in the other application.

I would gladly share that workaround. Right now, WinMerge is the only app that behaves like that, which makes it useless for my projects.

Gitoffthelawn commented 2 years ago

I would gladly share that workaround. Thank you. Same here. If I think of anything that may help you, I'll reach out and let you know.

Right now, WinMerge is the only app that behaves like that, which makes it useless for my projects. This is the odd part (and similar to my experience with the other application). There must be something different in the code causing the difference in behaviour. Isolating these things is usually requires quite a bit of time and effort, but is possible.

If you have the time, you may benefit from experimenting with different display drivers. Verifying that you have the latest driver is generally the first step. Contrarily, if you're using the latest driver, sometimes "downgrading" a version or 2 can help, or at least be useful for diagnosis. Similarly, sometimes switching to a generic driver (compatible with the graphics chipset you are using) can help.

Also, as of this writing, I don't use Windows 11. IIRC, it sends a whole bunch of telemetry to Microsoft. Does it offer a way to add data to that telemetry to indicate "take a close look at this telemetry... things aren't working well right now"?

ciprianmp commented 2 years ago

@Gitoffthelawn as promised:

After reading your reply, I went to my Windows settings to find the troubleshooter, just to discover that some lists in there were behaving the same, weird scrolling. At that point I realized it's not WinMerge but must be a driver. I must mention, at that point, I had latest Windows 11 build with latest Intel display driver and Nvidia GeForce driver installed.

I went to Windows Device manager and removed the Intel display driver (by removing the device and choosing to delete the driver info) - a Microsoft generic driver was then automatically loaded (actually after I chose to "Scan for hardware changes"). Went to WinMerge to test and, voila, scrolling is back to normal.

I don't know if any WinMerge/software line of code could prevent that behavior, but at least we know the source of the issue - display drivers (latest in my case, as of 27.04, which is just a few days ago)!

I hope this helps. And thanks for all your input.

Gitoffthelawn commented 2 years ago

@Gitoffthelawn as promised:

After reading your reply, I went to... ...I hope this helps. And thanks for all your input.

Thank you so very much for following up! I appreciate it!

And regarding your thanks, you're most welcome. :)

Given that you experienced the issue somewhere else is basically good news. I agree that it's almost certainly a driver issue (could, in theory, be a driver issue combined with one or more additional issues, but let's hope for the best!).

You mentioned that you had the "latest Intel display driver and Nvidia GeForce driver installed." Can you elaborate? I would think you would have one or the other, but not both. Perhaps I'm not understanding what you meant there?

ciprianmp commented 2 years ago

You mentioned that you had the "latest Intel display driver and Nvidia GeForce driver installed." Can you elaborate? I would think you would have one or the other, but not both. Perhaps I'm not understanding what you meant there?

I have a MSI laptop, GV72 8RD, which features an onboard Intel UHD Graphics 630 and an NVIDIA GeForce GTX 1050 Ti graphic card.

Gitoffthelawn commented 2 years ago

I have a MSI laptop, GV72 8RD, which features an onboard Intel UHD Graphics 630 and an NVIDIA GeForce GTX 1050 Ti graphic card.

Interesting. Do they run in parallel, or is one for the internal display and the other for an external display, or is the Intel chip usually disabled, or something else entirely?

ciprianmp commented 2 years ago

As best as I can describe it, but I am not an expert, they run simultaneously, integrated one deals with basic/easier rendering functions, while the more powerful GeForce take on the real hardware demanding ops, as gaming, video editing and so on. Many windows based powerfull 3d notebooks/laptops come with 2 video cards in the last years. https://www.quora.com/Why-do-laptops-have-two-graphics-cards-Nvidia-and-Intel

Gitoffthelawn commented 2 years ago

As best as I can describe it, but I am not an expert, they run simultaneously, integrated one deals with basic/easier rendering functions, while the more powerful GeForce take on the real hardware demanding ops...

Thank you for the info. I'll read up and learn more about it.