Gvim 7.4 on a Linux guest inside VirtualBox has serious redraw issues: often when I scroll up/down, the shown text gets corrupted (e.g., empty or with some \"holes\"). And I hav
I faced the same problem under Salix OS. As changing the acceleration settings in VirtualBox didn't solve the issue, I find it easier to build gvim with GTK+ 3 (as the bug was triggered by GTK+ 2, as mentioned in @user4134275 answer) than messing with the Window Manager and Desktop Environment.
The problem is related to some bug of Cinnamon, maybe showing up only when run inside VirtualBox with 3D acceleration enabled. I discovered, in fact, that the display was corrupted also for other applications (e.g., media player).
I solved the problem by switching to the Mate window manager through the following steps:
Now gvim and all other apps work fine.
Could be out of scope here, since I am using Fedora 21
here; but since this is the #1 result for gvim refresh issue, I am adding this note for later reference.
Do not hesitate to allocate a lot of video memory. I had played with 2D accelation
as well as 3D accelation
option without any single change. The gulty party was that by default I only had 12Mo
of video, I changed it to 128Mo
and everythnig is working nicely now.
There are lot of redraw issues. The solution(s) below address a very specific redraw issue with Windows 7 host, Linux guest, and Ubuntu (or Compiz).
Solution 1
Tested with the latest Virtual Box 5.0.4 & Guest Additions, Ubuntu 14.04.3, 3D Acceleration enabled, standard install with full updates.
a) sudo apt-get install compizconfig-settings-manager
b) Run it from the dash (type "ccsm"). Pick "Utility" on the left. Pick "Workarounds" (NOT the checkbox, click the button to enter sub category). "Force complete redraw on initial damage" should be on by default (not sure if relevant, just in case). Now ENABLE Force full screen redraws (buffer swap) on repaint, which is unchecked by default. The effect is immediate, if a gvim window is open just rapidly click between tabs, or jump top/bottom of files to see the difference.
Solution 2 (for 13.04, 13.10, or below)
If using 13.04 or below (perhaps 13.10 as well), first try to switch to Virtual Box 5.0.4+ (5.0.4 was tested) and its Guest Additions, install CCSM and test the workaround as described above (I can confirm this worked on my old 13.04 VM).
If that doesn't work or using the latest Virtual Box / Guest Additions is not an option then try to downgrade Guest Additions to version 4.2.12 (not just 4.2.x, trust me, I've tried many versions) NOTE that 4.2.12 won't work in Ubuntu 14.04.3+, due to the newer X Server version.
Older post below (some background)
Tests I went through:
Finally, after hours and hours of rebooting VMs...
Further
According to Bram Moolenaar "patch 7.3.638 merely removed an unnecessary redraw, which likely uncovered an existing problem" (with the GTK library).
However it's worth mentioning that I have been using an Ubuntu 13.04 VM for a year with Google Chrome, Firefox, Open Office, MySQL Workbench, etc. and have never had any other redraw issues. So even if it is a GTK bug it is a problem that appears to be closely tied to how VIM refreshes the window contents.
https://github.com/vim/vim/issues/91
Could be a GTK issue, but if it happens only with Windows 7 hosts... then it appears to be a "sync" problem between the GTK redraw / repaint events and the Open GL layer of Compiz (my guess).
How to reproduce / test bug
Open long text files in multiple tabs (saving/loading a session saves time).
Then quickly switch between tabs with Ctrl-PgUp / PgDn, or quickly move from top to bottom of a file with Ctrl-Home, Ctrl-End. Within seconds you will see only a part of the window refresh.