Mercurial > vim
changeset 7115:ec89519dfeea v7.4.869
commit https://github.com/vim/vim/commit/3b59755862f4604ded8155404a1fe4c84c606829
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 15 17:58:29 2015 +0200
patch 7.4.869
Problem: MS-Windows: scrolling may cause text to disappear when using an
Intel GPU.
Solution: Call GetPixel(). (Yohei Endo)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 15 Sep 2015 18:00:04 +0200 |
parents | 5abe2a7f33c8 |
children | d8cbf271f0e8 |
files | src/gui_w48.c src/version.c |
diffstat | 2 files changed, 25 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -2389,7 +2389,7 @@ show_tabline_popup_menu(void) return; if (first_tabpage->tp_next != NULL) - add_tabline_popup_menu_entry(tab_pmenu, + add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_CLOSE, _("Close tab")); add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_NEW, _("New tab")); add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_OPEN, @@ -2931,10 +2931,10 @@ gui_mswin_get_valid_dimensions( base_width = gui_get_base_width() + (GetSystemMetrics(SM_CXFRAME) + - GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; base_height = gui_get_base_height() + (GetSystemMetrics(SM_CYFRAME) + - GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 + GetSystemMetrics(SM_CYCAPTION) #ifdef FEAT_MENU + gui_mswin_get_menu_height(FALSE) @@ -2997,6 +2997,20 @@ get_scroll_flags(void) } /* + * On some Intel GPUs, the regions drawn just prior to ScrollWindowEx() + * may not be scrolled out properly. + * For gVim, when _OnScroll() is repeated, the character at the + * previous cursor position may be left drawn after scroll. + * The problem can be avoided by calling GetPixel() to get a pixel in + * the region before ScrollWindowEx(). + */ + static void +intel_gpu_workaround(void) +{ + GetPixel(s_hdc, FILL_X(gui.col), FILL_Y(gui.row)); +} + +/* * Delete the given number of lines from the given row, scrolling up any * text further down within the scroll region. */ @@ -3007,6 +3021,8 @@ gui_mch_delete_lines( { RECT rc; + intel_gpu_workaround(); + rc.left = FILL_X(gui.scroll_region_left); rc.right = FILL_X(gui.scroll_region_right + 1); rc.top = FILL_Y(row); @@ -3038,6 +3054,8 @@ gui_mch_insert_lines( { RECT rc; + intel_gpu_workaround(); + rc.left = FILL_X(gui.scroll_region_left); rc.right = FILL_X(gui.scroll_region_right + 1); rc.top = FILL_Y(row); @@ -3319,10 +3337,10 @@ gui_mch_newfont() GetWindowRect(s_hwnd, &rect); gui_resize_shell(rect.right - rect.left - (GetSystemMetrics(SM_CXFRAME) + - GetSystemMetrics(SM_CXPADDEDBORDER)) * 2, + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2, rect.bottom - rect.top - (GetSystemMetrics(SM_CYFRAME) + - GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 - GetSystemMetrics(SM_CYCAPTION) #ifdef FEAT_MENU - gui_mswin_get_menu_height(FALSE)