Gvim redraw issues with Virtual Box and Windows 7 host

后端 未结 4 1427
温柔的废话
温柔的废话 2021-02-05 09:33

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

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 10:17

    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:

    • Unity 2D: no bug, but ugly (no drop shadows, etc)
    • Mint 15 + CINNAMON : has bug
    • Mint 16 MATE : no bug, but some scroll bar issues
    • Mint 14.1 : no bug, because guest additions 4.1.18 pre-installed.. but SLOW!
    • ... upgrading guest additions to 4.3.6 : gvim bug reappears! <-- bingo

    Finally, after hours and hours of rebooting VMs...

    • 4.2.12 : no gvim redraw bug, works perfectly for me (Ubuntu 13.04, Mint 15 Cinnamon), relatively smooth for a VM (with semi transparent Terminal, and all the 3D kinks)
    • 4.2.18 : no gvim redraw bug, but SLOW for some reason
    • 4.2.20 : BUG !
    • 4.3.6 : BUG !

    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.

提交回复
热议问题