0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 7.4.869

Problem:    MS-Windows: scrolling may cause text to disappear when using an
            Intel GPU.
Solution:   Call GetPixel(). (Yohei Endo)
This commit is contained in:
Bram Moolenaar
2015-09-15 17:58:29 +02:00
parent 54f018cd59
commit 3b59755862
2 changed files with 25 additions and 5 deletions

View File

@@ -2389,7 +2389,7 @@ show_tabline_popup_menu(void)
return; return;
if (first_tabpage->tp_next != NULL) 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")); 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_NEW, _("New tab"));
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_OPEN, 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() base_width = gui_get_base_width()
+ (GetSystemMetrics(SM_CXFRAME) + + (GetSystemMetrics(SM_CXFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
base_height = gui_get_base_height() base_height = gui_get_base_height()
+ (GetSystemMetrics(SM_CYFRAME) + + (GetSystemMetrics(SM_CYFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+ GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYCAPTION)
#ifdef FEAT_MENU #ifdef FEAT_MENU
+ gui_mswin_get_menu_height(FALSE) + gui_mswin_get_menu_height(FALSE)
@@ -2996,6 +2996,20 @@ get_scroll_flags(void)
return 0; return 0;
} }
/*
* 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 * Delete the given number of lines from the given row, scrolling up any
* text further down within the scroll region. * text further down within the scroll region.
@@ -3007,6 +3021,8 @@ gui_mch_delete_lines(
{ {
RECT rc; RECT rc;
intel_gpu_workaround();
rc.left = FILL_X(gui.scroll_region_left); rc.left = FILL_X(gui.scroll_region_left);
rc.right = FILL_X(gui.scroll_region_right + 1); rc.right = FILL_X(gui.scroll_region_right + 1);
rc.top = FILL_Y(row); rc.top = FILL_Y(row);
@@ -3038,6 +3054,8 @@ gui_mch_insert_lines(
{ {
RECT rc; RECT rc;
intel_gpu_workaround();
rc.left = FILL_X(gui.scroll_region_left); rc.left = FILL_X(gui.scroll_region_left);
rc.right = FILL_X(gui.scroll_region_right + 1); rc.right = FILL_X(gui.scroll_region_right + 1);
rc.top = FILL_Y(row); rc.top = FILL_Y(row);
@@ -3319,10 +3337,10 @@ gui_mch_newfont()
GetWindowRect(s_hwnd, &rect); GetWindowRect(s_hwnd, &rect);
gui_resize_shell(rect.right - rect.left gui_resize_shell(rect.right - rect.left
- (GetSystemMetrics(SM_CXFRAME) + - (GetSystemMetrics(SM_CXFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2, GetSystemMetrics(SM_CXPADDEDBORDER)) * 2,
rect.bottom - rect.top rect.bottom - rect.top
- (GetSystemMetrics(SM_CYFRAME) + - (GetSystemMetrics(SM_CYFRAME) +
GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
- GetSystemMetrics(SM_CYCAPTION) - GetSystemMetrics(SM_CYCAPTION)
#ifdef FEAT_MENU #ifdef FEAT_MENU
- gui_mswin_get_menu_height(FALSE) - gui_mswin_get_menu_height(FALSE)

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
869,
/**/ /**/
868, 868,
/**/ /**/